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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to