Re: How to check if NSTextField is selected?
Re: How to check if NSTextField is selected?
- Subject: Re: How to check if NSTextField is selected?
- From: Shawn Erickson <email@hidden>
- Date: Thu, 28 Sep 2006 08:54:17 -0700
On Sep 28, 2006, at 8:36 AM, Peter Schart wrote:
On Sep 28, 2006, at 10:24 AM, Jordan Evans wrote:
How do I query NSTextField to know if it's the selected text field in
the interface. You know, when it has the blue highlighting around
it?
Ask the window what the first responder is and compare it to your
NSTextField object. Something like:
BOOL textFieldIsSelected = ([mainWindow firstResponder] ==
textFieldObject);
This doesn't play well with a text field that has the shared field
editor in place (aka someone is editing the text in the field). See
the link I posted in my prior email for more details.
-Shawn
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden