Re: NSTextField has cursor in it?
Re: NSTextField has cursor in it?
- Subject: Re: NSTextField has cursor in it?
- From: j o a r <email@hidden>
- Date: Fri, 5 Dec 2003 09:35:01 +0100
NSWindow has a "firstResponder" method that is suitable to use here.
How about something like this:
id firstResponder = [[self window] firstResponder];
id fieldEditor;
if ((firstResponder != myTextField) &&
(((fieldEditor = [myTextField currentEditor]) == nil) ||
(firstResponder != fieldEditor)))
{
NSLog(@"The text field doesn't have focus");
}
j o a r
On 2003-12-05, at 08.57, Louis C. Sacha wrote:
>
How about the NSControl method:
>
>
- (NSText *)currentEditor
>
If the receiver is being edited -- that is, it has an NSText object
>
acting as its field editor, and is the first responder of its NSWindow
>
-- this method returns the NSText editor; otherwise, it returns nil.
>
>
You could cycle through the NSTextFields, and the one that doesn't
>
return nil is the one currently being edited... Don't know if there is
>
a better option, and regarding the other response AFAIK there is no
>
isFirstResponder method documented as of 10.2.
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.