Updating menubars, what exactly does setMainMenu do?
Updating menubars, what exactly does setMainMenu do?
- Subject: Updating menubars, what exactly does setMainMenu do?
- From: David Elliott <email@hidden>
- Date: Tue, 19 Aug 2003 11:50:44 -0400
Hello all,
In wxCocoa when a menubar is attached to a top-level window I call
[NSResponder -setMenu:] on the NSWindow object to attach the menubar to
that window.
That seems to work if it is done before the window is displayed. Cocoa
apparently makes it the main menu when the NSWindow becomes key.
However, if I try to set the menu while the window is key then I find
that it doesn't change the active menubar.
I've thought of simply calling setMainMenu on the shared application
object since it seems that is what NSApplication is doing when the
window is made key. Assuming I do that, what happens when some other
window is made key? Does NSApplication always change out the menubar
if it is switching to an NSWindow that has one?
I intend to write a bunch of tests to figure all of this out, but any
insight would be greatly appreciated!
-Dave
_______________________________________________
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.