Re: How to detect focus on an NSTextField
Re: How to detect focus on an NSTextField
- Subject: Re: How to detect focus on an NSTextField
- From: Jens Alfke <email@hidden>
- Date: Fri, 8 Feb 2008 08:02:54 -0800
On 8 Feb '08, at 1:56 AM, Joachim Deelen wrote:
what about NSWindow firstResponder? This Method returns the Object,
that currently handles all Keyboard and Mouse Events at first.
The gotcha is that a text field itself is never the first responder.
Instead, the first responder is the window's fieldEditor, which is a
shared NSTextView that's used to manage text editing in whichever text
field (or text cell) is active.
What you need to do is check that the text field's currentEditor is
non-nil, and that the currentEditor itself is the window's
firstResponder.
—Jens_______________________________________________
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