Re: NSView subclass, contextual menu, mouse click...
Re: NSView subclass, contextual menu, mouse click...
- Subject: Re: NSView subclass, contextual menu, mouse click...
- From: Peter Fischer <email@hidden>
- Date: Wed, 10 Dec 2003 19:29:43 -0500
Hello -
Don't know if this is the right/wrong way to do this, but I have had
success doing the following:
//The code below is something I wrote to remove an application
from a list.
rightClick = [ [NSMenu alloc] initWithTitle:@"RightClick"];
//Add NSMenuItem(s) to the rightClick NSMenu
remove = [ [NSMenuItem alloc] init];
[remove setTitle:@"Remove Application"];
[remove setAction:@selector(removeSelf)];
[remove setTarget:self];
[rightClick addItem:remove];
//Add the right click as the default menu
[appButton setMenu:rightClick];
Hope this helps!
On Dec 10, 2003, at 3:52 AM, Rustam Muginov wrote:
Hi all.
I have NSView subclass where I've implemented "-(NSMenu *)menu" method.
Then I am control-clicking the view, it works fine, contextual menu is
displayed. But I can not get contextual menu then im right-clicking the
view. I am using Microsoft Intelliexplorer mouse.
How could I get the contextual menu as a result of a right-click?
Thank you.
_______________________________________________
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.
_______________________________________________
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.