popUpContextMenu is disabled !!
popUpContextMenu is disabled !!
- Subject: popUpContextMenu is disabled !!
- From: damian trzuskot <email@hidden>
- Date: Fri, 12 Jun 2009 20:24:32 -0700 (PDT)
Hi everyone. I am new here (also new to cocoa) and this is my first topic.
I am trying to make a simple application which has a NSView Custom View. I added a class "CustomView" to this view and overrided the rightMouseDown to show up a popUp menu. The sample code is from documentation
my code:
@implementation CustomView
- (void)mouseDown:(NSEvent *)theEvent {
NSMenu *theMenu = [[[NSMenu alloc] initWithTitle:@"Contextual Menu"] autorelease];
[theMenu insertItemWithTitle:@"Beep" action:NULL
keyEquivalent:@"" atIndex:0];
[theMenu insertItemWithTitle:@"Honk" action:@selector(honk:)
keyEquivalent:@"" atIndex:1];
[NSMenu popUpContextMenu:theMenu withEvent:theEvent forView:self];
}
and everything is working except that the menu is disabled. It is not highlighting when the mouse is over it. I can not click any of the items. What I am doing wrong? Thanks for any help.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden