Re: NSTextField has cursor in it?
Re: NSTextField has cursor in it?
- Subject: Re: NSTextField has cursor in it?
- From: Ron Ballesteros <email@hidden>
- Date: Fri, 5 Dec 2003 09:17:25 -0800
I'm wondering if this is the same method they used in System
Preferences/EnergySaver
to determine which NSTextField to update when the user clicks on the
NSStepper button?
This is the behavior I am trying to duplicate...
I open the nib file for the EnergySaver and they created a subclass of
NSControl
as the delegate for the NSTextFields of the hour and minute and I'm not
sure which delegate methods of NSTextField to implement to determine
which field the user 's cursor is on?
Thanks.
ron
On Dec 5, 2003, at 6:44 AM, email@hidden wrote:
Message: 5
Cc: Cocoa Dev Dev <email@hidden>
From: j o a r <email@hidden>
Subject: Re: NSTextField has cursor in it?
Date: Fri, 5 Dec 2003 09:35:01 +0100
To: "Louis C. Sacha" <email@hidden>
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
_______________________________________________
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.