• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Finding the active NSTextField
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Finding the active NSTextField
      • From: David Catmull <email@hidden>
  • Prev by Date: Formatter & table column, IB
  • Next by Date: Re: custom NSView problem
  • Previous by thread: Re: Formatter & table column, IB
  • Next by thread: Re: Finding the active NSTextField
  • Index(es):
    • Date
    • Thread