Inserting an NSSearchField inside an NSMenuItem
Inserting an NSSearchField inside an NSMenuItem
- Subject: Inserting an NSSearchField inside an NSMenuItem
- From: augusto callejas <email@hidden>
- Date: Fri, 4 Jun 2010 17:25:51 -0700
hi-
i'm adding an NSSearchField to an NSMenu by creating an NSMenuItem
and calling setView with the search field as the argument. i'm able to display
the search field properly, but it doesn't gain focus (no blinking cursor in the
search field) either when the NSMenu is displayed or when i click on the search
field itself. i found a previous discussion and none of its approaches have worked:
http://lists.apple.com/archives/cocoa-dev/2008/Jan/msg00138.html
my code:
NSMenuItem* firstItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:@"Test" action:nil keyEquivalent:@""];
NSSearchField *cField = [[[NSSearchField alloc] initWithFrame:NSMakeRect(0.0, 0.0, 250.0, 22.0)] autorelease];
[menu addItem:firstItem];
[firstItem setView:cField];
any ideas?
thanks,
augusto._______________________________________________
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