• 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: adding a sub menu to multiple super menus?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: adding a sub menu to multiple super menus?


  • Subject: Re: adding a sub menu to multiple super menus?
  • From: Jerry Krinock <email@hidden>
  • Date: Thu, 6 Aug 2009 11:28:56 -0700


On 2009 Aug 05, at 22:08, Graham Cox wrote:


On 06/08/2009, at 5:41 AM, David M. Cotter wrote:

in carbon, you can have a sub menu that is used in more than one super menu.

is there a trick to get this to go in Cocoa?

As far as I know a menu has to be a distinct instance - you can't share them. I think I tried it once and it failed miserably.

I've never tried that, but one thing that would work is to generate the menu on the fly when it's needed. You can use the same method to generate each submenu. For example, I have a contextual menu item which contains two items "Copy To ->" and "Move To ->". The method you'll want to use is -menuNeedsUpdate. The stated purpose of this method is for lazy generation of hierarchical menus, but it should work for David's purpose also.


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: adding a sub menu to multiple super menus?
      • From: "David M.Cotter" <email@hidden>
References: 
 >adding a sub menu to multiple super menus? (From: "David M. Cotter" <email@hidden>)
 >Re: adding a sub menu to multiple super menus? (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: Two right buttons on UINavigationBar?
  • Next by Date: Re: "Could not support development." (after updating iPhone to 3.0.1)
  • Previous by thread: Re: adding a sub menu to multiple super menus?
  • Next by thread: Re: adding a sub menu to multiple super menus?
  • Index(es):
    • Date
    • Thread