Skip navigation.
 
mlRe: implementing pop up menus
FROM : James McCartney
DATE : Sat Jan 18 19:24:17 2003

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_removed>  <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_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

Related mailsAuthorDate
mlimplementing pop up menus James McCartney Jan 18, 08:46
mlRe: implementing pop up menus mw Jan 18, 14:32
mlRe: implementing pop up menus James McCartney Jan 18, 19:24
mlRe: implementing pop up menus Shaun Wexler Jan 18, 19:46
mlRe: implementing pop up menus Jim Correia Jan 18, 20:00
mlRe: implementing pop up menus James McCartney Jan 18, 23:12