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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to