Menu Key Equivalents Not Displayed
Menu Key Equivalents Not Displayed
- Subject: Menu Key Equivalents Not Displayed
- From: Jonathan Dann <email@hidden>
- Date: Sun, 6 Apr 2008 20:01:33 +0100
Hi Guys,
This one has me stumped. I have a NSSegmentedControl with a segment
that has a menu attached. I set up the menu like this
NSMenu *actionMenu = [[[NSMenu alloc] initWithTitle:@"actionMenu"]
autorelease];
NSMenuItem *newFileItem = [[[NSMenuItem alloc]
initWithTitle:NSLocalizedString(@"NewFile",@"")
action:@selector(showNewFileSheet:) keyEquivalent:@"n"] autorelease];
[newFileItem setKeyEquivalentModifierMask:NSCommandKeyMask];
[actionMenu addItem:newFileItem];
NSMenuItem *newGroupItem = [[[NSMenuItem alloc]
initWithTitle:NSLocalizedString(@"NewGroup",@"")
action:@selector(showNewGroupSheet:) keyEquivalent:@"g"] autorelease];
[newGroupItem setKeyEquivalentModifierMask:NSCommandKeyMask];
[actionMenu addItem:newGroupItem];
[self.segmentedControl setMenu:actionMenu forSegment:0];
However the command-G does not show up on the menu. The same happens
if I set the key equivalent to @"p", @"q" and some others, but
equivalents like @"u" and @"b" work fine. Can anyone verify this for
me please as I think I'm going mad. I have a contextual menu in a
source list with exactly the same shortcuts specified and these show
up fine. I've also tested it with different titles of differing
lengths and it seems to be only dependent on the keyEquivalent
argument. There doesn't seem to be anything in the docs and Google
comes up blank. Has anyone seen this behaviour before? My segmented
control is set to NSSmallControlSize, but using NSRegular or NSMini
doesn't fix it either.
Thanks in advance,
Jon
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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