NSMenu as a submenu of more than one NSMenu
NSMenu as a submenu of more than one NSMenu
- Subject: NSMenu as a submenu of more than one NSMenu
- From: David Elliott <email@hidden>
- Date: Fri, 22 Aug 2003 17:33:36 -0400
Hello again,
I see now essentially what I'm going to have to do to make wxCocoa's
menus work properly. For one, I'm going to need a base menu with basic
functionality such as the application menu, the edit menu, and the
window menu.
When a window becomes the key window I will [NSApplication
-setMainMenu:] to that window's menu. When it resigns key window I
will setMainMenu: to the base menu. However, because it is most
desirable to have one common menu I will be adding functionality to
wxWindows that allows one window's menu to be designated as the base
menu for windows and modeless dialogs which don't otherwise have a menu.
Now, here's the trouble. Since a typical app is going to have more
than one menu, will it be okay if I create the application menu
(setAppleMenu:) and window menu (setWindowsMenu:) and attach them to
the base menu and later also attach them to other menus?
The way I'm reading the API documentation, it seems it would be okay if
I do this so long as I use a unique NSMenuItem for each attachment
point. If this is not possible then can I get away with leaving the
NSMenuItem in the menu, but setting it's subview to nil and back again
as appropriate? I'm almost positive that the latter method could not
possibly cause any problems. The former I'm not too sure of, it seems
odd to have a menu attached to multiple menus.
Thanks a bunch!
-Dave
P.S. I've made quite a lot of progress with wxCocoa lately. Come on
over to www.wxwindows.org and check it out of CVS. I hope to get
everything related to menus straightened out over this weekend.
_______________________________________________
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.