Re: Selecting Root of sub menu (NSMenu)
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.