• 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: Find which NSTextField is current responder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Find which NSTextField is current responder


  • Subject: Re: Find which NSTextField is current responder
  • From: Matt Neuburg <email@hidden>
  • Date: Tue, 05 Jul 2005 10:26:02 -0700

On Tue, 5 Jul 2005 13:38:30 +0200, John Nairn <email@hidden> said:
>I needed to find which of my list of NSTextFields (returned by
>respondingCells) was the current responder bu writing the following
>code:
>
>- (int)selectedStructureIndex
>{
>     int i;
>     NSArray *rCells=[self respondingCells];
>     id obj,firstResponder=[myWindow firstResponder];
>     for(i=0;i<[rCells count];i++)
>     {   if([rCells objectAtIndex:i]==firstResponder)
>             return i;
>     }
>     return NSNotFound;
>}
>
>but it does not work. Even though all potential responders in my
>window are NSTextFields, the firstResponder of the window is never an
>NSTextField but rather the NSTextView that is handling editing for
>the currently selected NSTextField.

That is the "field editor".

>The  problem then is how to find
>out which NSTextField is the one being edited by that NSTextView that
>is returned by the window's firstResponder?

<http://www.cocoabuilder.com/archive/message/2004/8/1/113411>

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

  • Prev by Date: Re: NSMetadataQuery not handling scopes and predicates as expected
  • Next by Date: Re: HTML + CSS specs used in the WebKit for NSTextView
  • Previous by thread: Find which NSTextField is current responder
  • Next by thread: NSTask Question
  • Index(es):
    • Date
    • Thread