Re: implementing pop up menus
Re: implementing pop up menus
- Subject: Re: implementing pop up menus
- From: mw <email@hidden>
- Date: Sat, 18 Jan 2003 08:32:00 -0500
On 1/18/03 2:46 AM, "James McCartney" <email@hidden> wrote:
>
OK I've got an NSView subclass that contains widgets that are not
>
NSViews. I want to have a mouse click in certain locations pop up a
>
menu selection. I can do that using
>
NSMenu popUpContextMenu:withEvent:forView:
>
but afaik, the above method does not give me control over what item is
>
under the mouse when it pops up. The above only seems useful for
>
contextual menus. I need to call whatever NSPopUpButton uses to bring
>
up a menu. What is that?
Why don't you just make an instance variable in your custom class of type
NSMenu that holds the menu you want to pop up? That way, when you get a
mouseDown event, you can simply use that NSMenu in
popUpContextMenu:withEvent:forView:
mw
_______________________________________________
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.