• 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
Re: NSView subclass, contextual menu, mouse click...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >NSView subclass, contextual menu, mouse click... (From: Rustam Muginov <email@hidden>)

  • Prev by Date: Re: AuthorizationExecuteWithPrivileges leaving zombie processes! Help?
  • Next by Date: NSRulerView question
  • Previous by thread: NSView subclass, contextual menu, mouse click...
  • Next by thread: root user cannot compile NSAppleScript
  • Index(es):
    • Date
    • Thread