• 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
NSSearchField menu + key equivalents
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: _NSAppKitImgCacheLock?
  • Next by Date: Re: Using an IB-built view multiple times
  • Previous by thread: _NSAppKitImgCacheLock?
  • Next by thread: NSEnumerator confusion
  • Index(es):
    • Date
    • Thread