• 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
Re: Selecting submenu root
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Selecting submenu root


  • Subject: Re: Selecting submenu root
  • From: Benoit Widemann <email@hidden>
  • Date: Sun, 30 Jun 2002 17:33:35 +0200

At 9:27 -0500 30.06.02, Brian Webster wrote:
But the problem is, how to get a MenuRef from a NSMenu?

If you're working on the main menu bar, you can probably avoid using private API by calling the Carbon function AcquireRootMenu(), which will give you a a MenuRef for the main menu. You can then navigate the menu hierarchy from there.


Unfortunately this only reverses the problem: I have no way to match my NSMenu among the existing Carbon menus. Anyway, the private call works fine, so I'll leave the question open. :-)

There is a secondary problem, which, as far as I could find, has not been mentioned in the archives (I'm getting careful). The Carbon menu is not created when the Cocoa menu is created, but only the first time the menu is actually dropped down. Until that moment, the private call returns nil.

This reminds me of another topic recently discussed, about the long time it can take for a complicated menu to drop down the first time it appears. It looks like the whole thing is created only when [if] it's really needed.

I guess it makes sense, but the Cocoa API is badly missing a call to force the pre-building (and pre-imaging) of the menu, when that's what's wanted by the developer. This is an extra sluggish-feeling for the user that could be easily avoided.

Benoit Widemann
_______________________________________________
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.

  • Follow-Ups:
    • Re: Selecting submenu root
      • From: Nicholas Riley <email@hidden>
References: 
 >Re: Selecting submenu root (From: Brian Webster <email@hidden>)

  • Prev by Date: Re: Figuring out the way the document classes work together. Some questions.
  • Next by Date: I'm so angry.
  • Previous by thread: Re: Selecting submenu root
  • Next by thread: Re: Selecting submenu root
  • Index(es):
    • Date
    • Thread