Re: Find which NSTextField is current responder
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