NSSearchField menu + key equivalents
NSSearchField menu + key equivalents
- Subject: NSSearchField menu + key equivalents
- From: Justin Anderson <email@hidden>
- Date: Tue, 20 Sep 2005 18:42:15 -0400
I have an NSSearchField containing a search menu, with each menu item
representing a different search category (like Artists, Album, Song).
I want to allow using key equivalents to switch between categories
instead of requiring mousing around. However, key equivalents don't
reach the NSSearchField's menu unless the field's menu is open
(clicked on and visible). Is there something I'm missing? Is there
any way to forward key equivalents to the menu?
The menu is created in a loop of:
for (i = 0; i < [searchCategoriesArray count]; i++) {
item = [[NSMenuItem alloc] initWithTitle:[[searchCategoriesArray
objectAtIndex:i] valueForKey:@"title"]
action:@selector
(searchTypeDidChange:)
keyEquivalent:@""];
[item setTarget:self];
[item setTag:i];
[item setKeyEquivalent:[NSString stringWithFormat:@"%d", i + 1]];
[item setKeyEquivalentModifierMask:NSCommandKeyMask];
[searchMenu insertItem:item atIndex:i];
[item release];
}
Any help is greatly appreciated.
Justin Anderson
http://www.tensaimac.com/
_______________________________________________
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