Re: implementing pop up menus
Re: implementing pop up menus
- Subject: Re: implementing pop up menus
- From: James McCartney <email@hidden>
- Date: Sat, 18 Jan 2003 10:24:17 -0800
On Saturday, January 18, 2003, at 05:32 AM, mw 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:
That's not the problem. I have a menu and it is popping up. The problem
is that with popUpContextMenu:withEvent:forView: the menu is not
aligned where I want it and it does not pop up selecting the menu item
that I want.
--
--- james mccartney email@hidden <
http://www.audiosynth.com>
SuperCollider - a real time synthesis programming language for the
PowerMac.
<
ftp://www.audiosynth.com/pub/updates/SC2.2.16.sea.hqx>
_______________________________________________
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.