• 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
duplicate menu items created?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

duplicate menu items created?


  • Subject: duplicate menu items created?
  • From: Gary Yuen <email@hidden>
  • Date: Wed, 15 Feb 2006 11:46:56 -0800

Hi,

I'm creating an InputManager for Safari. I have the guts of what I want done. Now I'm just creating a menu item for it to toggle it's state. With the following code, I get two menu items.

NSMenuItem* menuItem;
menuItem = [[NSMenuItem alloc] initWithTitle:@"...." action:@selector (toggleEnabled:) keyEquivalent:@"g"];
[menuItem setKeyEquivalentModifierMask:NSAlternateKeyMask | NSCommandKeyMask];


	root_ = menuItem;
	[menuItem setState: NSOnState];
	[menuItem setToolTip:@"....."];

NSMenu* applicationMenu = [[[[NSApplication sharedApplication] mainMenu] itemAtIndex: 0] submenu];
[applicationMenu insertItem:menuItem atIndex:5];
[menuItem release];


Though nly one of the menu items has the keyEquivalent set. Any ideas? :)

Gary
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: "Path arithmetic" support in Quartz
  • Next by Date: Re: "Path arithmetic" support in Quartz
  • Previous by thread: Re: NSTimer and -[NSObject performSelector:withObject:afterDelay:] in the background?
  • Next by thread: Strange file system behavior
  • Index(es):
    • Date
    • Thread