Re: setAppleMenu? yeah, right!
Re: setAppleMenu? yeah, right!
- Subject: Re: setAppleMenu? yeah, right!
- From: James DiPalma <email@hidden>
- Date: Wed, 25 Sep 2002 19:06:52 -0400
From: Kerry Hazelgren <email@hidden>
I've tried a hundred different ways to use the call [NSApp
setAppleMenu:], but to no avail. It ignores my request each time.
I tried this too; did not work.
The only reason I am interested in this at all is because setMainMenu
causes the application (apple) menu to loose it's submenu. Obviously
the two are related, but the documentation is not clear on whether the
menu you use to set the main menu should include the apple menu or not.
If the menu you use in setMainMenu: includes an "Apple menu" menu, it
will be set as your application menu. By "Apple menu" menu, I mean a
menu that shows up in IB's attributes inspector as an "Apple menu"
Special Menu. You can see disabled radio buttons in that inspector that
list out other special menus; on IB's Cocoa-Menus palette, the menu
titled "Application" is an "Apple menu".
At any rate, I can set the main menu bar just fine, but can't get my
own menu to appear under the application's name; it is either ignored
and a default menu is used, or it loses its submenu entirely.
I was able to use setMainMenu: and get a customized application (apple)
menu by connecting my application delegate to a new menu that was also
inside of my MainMenu.nib file.
There must be some undisclosed criteria for acceptance that the apple
menu must have, either that or there is no way to set it
programmatically.
I tried using an "Apple menu" when calling setAppleMenu: but that
didn't work either. Maybe it is a bug.
And to head off any mistaken replies, no I cannot set it in IB
If you can't configure your application menu in your MainMenu.nib file,
then maybe you can't use a Special Menu archived into a nib file. If
not, you may have some trouble using setMainMenu: to result in a
non-empty application (apple) menu.
You could try iterating through NSApplication's -mainMenu, find your
application menu and use addItem, removeItem on it directly.
Hope that helps,
-jim
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.