Re: NSSearchField in menu item weirdness
On May 13, 2008, at 4:22 PM, Peter Ammon wrote: On May 13, 2008, at 2:32 PM, Jim Turner wrote: This never gets called unless I actually click in the search field. My custom NSView has this as it's implementation of viewDidMoveToWindow to move the cursor into the field: -(void) viewDidMoveToWindow { [[self window] makeFirstResponder:searchField]; } It almost seems like this isn't really making the field the first responder, at least not in the way that clicking on the field does. Any thoughts on how to "properly" assign first responder status to a text field in a view of a NSMenuItem? Hi Jim, This is a known bug. ...I meant to follow this up with "and I don't know of good any workaround yet." -Peter ___ 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 [EMAIL PROTECTED]
Re: NSSearchField in menu item weirdness
On May 13, 2008, at 2:32 PM, Jim Turner wrote: This never gets called unless I actually click in the search field. My custom NSView has this as it's implementation of viewDidMoveToWindow to move the cursor into the field: -(void) viewDidMoveToWindow { [[self window] makeFirstResponder:searchField]; } It almost seems like this isn't really making the field the first responder, at least not in the way that clicking on the field does. Any thoughts on how to "properly" assign first responder status to a text field in a view of a NSMenuItem? Hi Jim, This is a known bug. And as a somewhat related question, can one programmatically change the highlighted item in a menu? There doesn't appear to be a selectMenuItemAtIndex: method... As always, thanks No, this isn't possible yet. Sorry I don't have better news, -Peter ___ 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 [EMAIL PROTECTED]
NSSearchField in menu item weirdness
I have a custom NSView that contains static text and a NSSearchField, it's your run-of-the-mill attempt to provide live search in a menu, a la the Apple help menu. My issue is that while I can get the cursor into the search field, if I type something other than standard text (arrow keys, home, end, etc), the search field's action is fired and I receive the character value of said key. As you can surmise, this doesn't really return the right results. I would like the user to be able to use the down arrow key to move out of the search field, so I implemented controlView:textView:doCommandBySelector: for the search field's delegate to catch moveDown: This never gets called unless I actually click in the search field. My custom NSView has this as it's implementation of viewDidMoveToWindow to move the cursor into the field: -(void) viewDidMoveToWindow { [[self window] makeFirstResponder:searchField]; } It almost seems like this isn't really making the field the first responder, at least not in the way that clicking on the field does. Any thoughts on how to "properly" assign first responder status to a text field in a view of a NSMenuItem? And as a somewhat related question, can one programmatically change the highlighted item in a menu? There doesn't appear to be a selectMenuItemAtIndex: method... As always, thanks -- Jim http://nukethemfromorbit.com ___ 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 [EMAIL PROTECTED]