[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
NSApplication bug/suggestion?
From: |
Ludovic Marcotte |
Subject: |
NSApplication bug/suggestion? |
Date: |
Thu, 15 Nov 2001 15:05:50 -0500 (EST) |
Hi,
In NSApplication: -setMainMenu, we search for setting our _windows_menu
ivar by comparing the title of the menu items of the main menu with
@"Windows" and @"Window".
Everything is fine except when your run an application that has been
translated to an other language and the menu item is not "Windows" (like
"FenĂȘtres" in french).
In that case, _windows_menu will always be nil and
NSApplication: -changeWindowsItem: title: filename: won't do anything
(ie., we won't have the list of opened windows in the [NSApplication
-windowsMenu]).
This problem comes from the fact that we are sharing the main menu for
each language. This problem is easy fixable if we use a "main nib" for
each different languages (like under OPENSTEP and MacOS-X) with its own
menu.
To fix this problem under GNUstep (if we don't want to use nibs for now),
I think we should introduce an ivar:
NSString *_windows_menu_title;
and a method:
- (void) setWindowsMenuTitle: (NSString *) theTitle; (that sets the ivar).
By default, this ivar will be set to "Windows". A developer could do
for example:
[NSApp setWindowsMenuTitle: @"FenĂȘtres"] (or any string it a different
language)
[NSApp setMainMenu: myMainMenu];
and things would be fine.
I've attached a small patch for NSApplicatio.{h,m}.
Anyone wants to share his/her opinion on this?
Ludo
--
Live as if you were to die tomorrow.
Learn as if you were to live forever.
- Gandhi
NSApplication.h.patch
Description: Text document
NSApplication.m.patch
Description: Text document
- NSApplication bug/suggestion?,
Ludovic Marcotte <=