• 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
Adding sub menus programatically
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Adding sub menus programatically


  • Subject: Adding sub menus programatically
  • From: Michael Davey <email@hidden>
  • Date: Thu, 24 Dec 2009 20:25:17 +1100

Hi,

I have googled around but have found nothing that can help me with this... I have a menu in my application that I wish to add sub items to programatically. I have the Menu itself connected up and I can add NSMenuItems to it just fine, but seem at a loss to be able to add a sub menu and the sub itmes to that menu.

I suspect my answer lies in this function:

- (void)setSubmenu:(NSMenu *)aMenu forItem:(NSMenuItem *)anItem

But I do not understand what the forItem part of the method is for. Further, I can retrieve a menu item from the menu, but am also at a loss as to how to retrieve my submenu at a stage in the future.  I have a feeling that there is something very simple that I am not understanding here, and would be very grateful if someone could point me in the right direction.

And Merry Christmas to everyone!!!

Mikey_______________________________________________

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 sub menus programatically
      • From: Paul Bruneau <email@hidden>
  • Prev by Date: Re: Releasing Objects
  • Next by Date: Re: Call Cocoa from C++
  • Previous by thread: Re: Is there a warning for this?
  • Next by thread: Re: Adding sub menus programatically
  • Index(es):
    • Date
    • Thread