Toolbar Item -Menu Form Representation - Key Equivalent
Toolbar Item -Menu Form Representation - Key Equivalent
- Subject: Toolbar Item -Menu Form Representation - Key Equivalent
- From: Richard Somers <email@hidden>
- Date: Mon, 20 Sep 2010 21:08:38 -0600
The key equivalent will not work for a toolbar item, menu form
representation.
The relevant code is
NSToolbarItem *item = [[NSToolbarItem alloc]
initWithItemIdentifier:identifier];
[item setLabel:label];
[item setPaletteLabel:paletteLabel];
[item setToolTip:toolTip];
NSMenuItem *menuFormRep = [[NSMenuItem alloc] initWithTitle:@""
action:nil keyEquivalent:@""];
NSMenu *submenu = [[[NSMenu alloc] initWithTitle:@""]
autorelease];
[submenu addItemWithTitle:@"Thing1" action:@selector(change:)
keyEquivalent:@"1"];
[submenu addItemWithTitle:@"Thing2" action:@selector(change:)
keyEquivalent:@"2"];
[menuFormRep setSubmenu:submenu];
[item setMenuFormRepresentation:menuFormRep];
Everything works but the key equivalent does nothing, 'change:' is not
called.
Has anyone had success with a key equivalent for a toolbar item, menu
form representation?
--Richard
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden