Re: Stop edit session with a NSTextField
Re: Stop edit session with a NSTextField
- Subject: Re: Stop edit session with a NSTextField
- From: Andy Lee <email@hidden>
- Date: Wed, 25 Feb 2009 11:14:44 -0500
On Feb 24, 2009, at 6:08 PM, Eric Gorr wrote:
*** [[[self view] window] makeFirstResponder:[self view]];
Pressing return will allow the editing session to end, but pressing
the tab key will not
Looks like controlTextDidEndEditing: is too deep within the text
field's event handling to muck with the first responder. Delaying the
call to makeFirstResponder: seems to work:
[[[self view] window]
performSelector:@selector(makeFirstResponder:) withObject:nil
afterDelay:0.0];
(Note this passes nil to makeFirstResponder: rather than the view.) I
don't know if this is foolproof -- for example, I haven't tried it
with different accessibility settings. And note that if you normally
have a tab loop this will defeat the tab loop.
--Andy
aglee
_______________________________________________
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