• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Updating menubars, what exactly does setMainMenu do?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: Subclassing NSSlider and mouse events
  • Next by Date: Re: Creating Video Software
  • Previous by thread: Re: Subclassing NSSlider and mouse events
  • Next by thread: Re: Updating menubars, what exactly does setMainMenu do?
  • Index(es):
    • Date
    • Thread