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: Adam Gerson <email@hidden>
- Date: Mon, 18 Feb 2008 03:41:18 -0500
Jens Alfke wrote:
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
I was able to check that the text field's currentEditor is non-nil by
calling a method, but I want to kick off an action as soon as it becomes
non nill (gets focus). Is there any way to detect this?
What is the syntax to determine if the currentEditor itself is the
window's firstResponder?
How would I go about detecting a single click inside my NSTextField?
That could solve this problem as well.
Thanks,
Adam
_______________________________________________
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