• 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: Building menu's lazily
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Building menu's lazily


  • Subject: Re: Building menu's lazily
  • From: Tobias Klüpfel <email@hidden>
  • Date: Tue, 26 Aug 2003 14:23:25 +0200

Hi Hsu,

On Dienstag, 26. August 2003, at 11:47AM, Alastair J.Houghton wrote:

On Tuesday, August 26, 2003, at 09:16 am, Hsu wrote:

Is there a way (Carbon or Cocoa) to build up a menu lazily?

Take a look at the ADC-TV samples.


Also have a look at the API description for the NSMenu delegate methods.
menuNeedsUpdate: would be called just before your menu would be displayed, so you could defer populating your menu until then. You would, however also have to implement the methods numberOfItemsInMenu: and menuHasKeyEquivalent: forEvent: target:action:, because the Application wouldn't know about things like key shortcuts and suchlike at the time your menu had not been populated yet.

My advice is to have a background thread generate the menu, unless the user clicks on a menu item, which would force you to block execution to generate the menu.

HTH
Toby
_______________________________________________
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: Building menu's lazily
      • From: Hsu <email@hidden>
References: 
 >Re: Building menu's lazily (From: "Alastair J.Houghton" <email@hidden>)

  • Prev by Date: Re: putting structs in NSArray
  • Next by Date: How to display an EPS file?
  • Previous by thread: Re: Building menu's lazily
  • Next by thread: Re: Building menu's lazily
  • Index(es):
    • Date
    • Thread