Re: Finding the active NSTextField
Re: Finding the active NSTextField
- Subject: Re: Finding the active NSTextField
- From: Matt Neuburg <email@hidden>
- Date: Sun, 12 Sep 2004 10:21:03 -0700
On Fri, 10 Sep 2004 18:14:00 -0600, David Catmull
<email@hidden> said:
>On Sep 10, 2004, at 4:45 PM, Matt Neuburg wrote:
>> [[theWindow fieldEditor:YES forObject:nil] delegate]
>
>That almost works. If one of the fields *not* affected by the radio
>buttons is focused, then I get the desired result with that call. If
>the focused field *is* one of these fields that I'm actually trying to
>check for, it gives me nil! That seems pretty wacky to me. They're all
>just NSTextFields.
Seems wacky to me too. I've used this for years and have never seen it not
work. If it returns nil, that would be because no text field has the focus.
(For example, if full keyboard access is turned on, a button can have focus,
thus taking the focus away from the text field.)
The alternative, as I think you know already, is to poll all the text fields
and ask each of them in turn which has a non-nil currentEditor. But I would
be very surprised if that gave a different answer. If it does, I'd certainly
like to hear about it! m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide
<http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt>
_______________________________________________
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