Re: Contextual menu w/o right click?
Re: Contextual menu w/o right click?
- Subject: Re: Contextual menu w/o right click?
- From: Andrew Platzer <email@hidden>
- Date: Thu, 24 Jan 2002 14:17:32 -0800
On Wednesday, January 23, 2002, at 06:29 , Michael Peirce wrote:
In a UI I'm working on I'd like to have a menu popup on click rather than
right-click (or control-click).
I don't see any API to force a contextual menu to be invoked, though I
did see a method in NSView called "popUpContextMenu", but the
documentation says "Description forthcoming".
+ (void)popUpContextMenu:(NSMenu*)menu withEvent:(NSEvent*)event forView:
(NSView*)view
Description forthcoming.
I've tried using this blindly, but without success.
Anyone know if popUpContextMenu should do what I need?
Or have another solution for putting up a contexual menu-like menu?
Unless you want to control the placement, yes, popUpContextMenu: is what
you need. BTW, this is an NSMenu method, not NSView.
The other option is to set the menu for a view and then have the mouseDown:
method call rightMouseDown: (which calls menuForEvent: but that always
returns the same menu).
When you say "without success", does nothing pop up, do you get log
messages, etc?
Andrew
__________________________________________________________________
A n d r e w P l a t z e r
A p p l i c a t i o n F r a m e w o r k s
A p p l e