Re: Selecting Root of sub menu (NSMenu)
Re: Selecting Root of sub menu (NSMenu)
- Subject: Re: Selecting Root of sub menu (NSMenu)
- From: Rob Petrovec <email@hidden>
- Date: Sat, 19 Oct 2002 03:06:29 -0700
Thanks for the reply, but it seems that NSGetCarbonMenu only works with
menu's created via Nib files. I am creating my menu from scratch in my
code. When I call NSGetCarbonMenu it always returns NULL.
--Rob
On 10/18/02 8:52 PM, "Dustin Voss" <email@hidden> wrote:
>
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?
_______________________________________________
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.