• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
popUpContextMenu is disabled !!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: X-Code and Subversion
  • Next by Date: Re: Creating new Xcode projects into Subversion (Was: Xcode and Subversion)
  • Previous by thread: Re: How to view ALL svn revisions?
  • Next by thread: Problem on drawing custom scroller.
  • Index(es):
    • Date
    • Thread