• 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 Root of sub menu (NSMenu)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Selecting Root of sub menu (NSMenu)


  • Subject: Re: Selecting Root of sub menu (NSMenu)
  • From: Dustin Voss <email@hidden>
  • Date: Fri, 18 Oct 2002 20:52:15 -0700

On Wednesday, October 16, 2002, at 06:59 PM, Rob Petrovec wrote:

I have an NSMenu that contains a couple submenu's. Each item has its own
action to handle the selection of that item. The problem is that when the
user selects the root of one of the submenu's (i.e. The item with the
triangle in its name), the action selector doesn't get called. Nothing
happens. Is there a way I can get this to work? Thanks for any help...

--Rob

You have to use an undocumented function _NSGetCarbonMenu to get the Carbon MenuRef of the menu, and set the root item's kMenuItemAttrSubmenuParentChoosable attribute. Without this, you can't choose a sub-menu's parent at all.

But, having set that attribute, I don't know if you can use Cocoa to set an action. It may be that you'll have to use Carbon events to tell if the item was selected. I just don't know. Maybe someone else can take it from here?

--
Dustin
_______________________________________________
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 Root of sub menu (NSMenu)
      • From: Rob Petrovec <email@hidden>
References: 
 >Selecting Root of sub menu (NSMenu) (From: Rob Petrovec <email@hidden>)

  • Prev by Date: Re: GUI style question
  • Next by Date: Re: NSLayoutManager vs BBEdit (Was Re: Carbon vs Cocoa arguments)
  • Previous by thread: Selecting Root of sub menu (NSMenu)
  • Next by thread: Re: Selecting Root of sub menu (NSMenu)
  • Index(es):
    • Date
    • Thread