 |
 |
Major Problem (bug ?) With Menus and IB
|
 |
|
 |
|
Forum Regular
Join Date: Mar 2001
Status:
Offline
|
|
Hi,
I have noticed a major issue with menus and IB.
Environment :
- Mac OS X 10.0.3
- Developer Tools from Mac OS X retail CD
- PowerBook G3 Lombard 333MHz (bronze keyboard)
The problem :
I launch Project Builder, then I create a new Cocoa Document Based Application from the template.
I open the MainMenu.nib file with Interface Builder, then I change the name of a menu by double-clicking it and edit the name in the View Info Palette. I verify that this is the MenuItem name that is changed in the Instances list view. That is right.
I save modifications, I compile, and launch my application. The Menu title in the menu bar are always ("AppName" File Edit Window Help). The titles when running the app do not reflect names set with IB. However submenus reflect those in the nib file.
Then I try to verify in debug mode with :
char *test;
test = [[[[NSApp mainMenu] itemAtIndex:anIndex] title] cString];
Stopped at breakpoint : test reflect the name I have put in IB.
When I put something like :
[[[NSApp mainMenu] itemAtIndex:anIndex] setTitle:@"testTitle"];
the names in the menubar does not reflect the new title.
The bug is more important :
I make a localized French nib with title in French.
My System main language is French (in System Preferences)
I launch my App, and the menubar items remains the same in english !
The sub menu items are OK : the same as on the localized nib file.
Is it a bug ? Or have I forgotten something ? It seems the App displays the object type on the menubar, and not the attributed item name, If I add a submenu in the menubar with title "TestMenu", the name is "Submenu" in the running app.
Thanks for your help, or to confirm this is a bug.
|
|
Imagine that my signature is here...
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status:
Offline
|
|
I might've misunderstood the question, but for your localized nib, make sure you put it in a French.lproj folder, and call it MainMenu.nib
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Mar 2001
Status:
Offline
|
|
Angus,
The localized nib file is where it is supposed to be. All things are OK, except the menubar items name.
I always have "AppName" File Edit Window Help
Nor in English.lproj, nor in French.lproj my running Application menubar reflects the titles set programmaticaly or with IB.
Even in IB, when I test the Interface, the menu names are still always the same.
The problem is only with the menubar items name. All submenu items are OK.
|
|
Imagine that my signature is here...
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Mar 2001
Status:
Offline
|
|
I have found a way to correct the problem, however, it should be a bug that corrupts the nib file or Idontknowwhat.
If I create another File menu submenu into the Edit menu for exemple, and then I copy (alt click) it in the MainMenu (= the menubar picture in IB), then all my changes to MainMenu menuItems titles are reflected in project builder "Test Interface" and during application running. However, the copy does not occurs, since IB know there is already a File menu, but it may change something to the nib file so that it works fine.
However, I am curious, and I would like to understand what is the cause of the problem...
It is strange to see that this corrupted thing force the App to display menuItems type as title instead of menuItems names. Even changing programmaticaly the title does not change anything. And getting the name proves that the title is the one that is set with IB into the nib file.
I will submit this as a feedback bug to Apple.
thanks for reading this ;-)
[This message has been edited by hELLO wORLD (edited 05-14-2001).]
|
|
Imagine that my signature is here...
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|