Re: getFocus on NSTextField
Re: getFocus on NSTextField
- Subject: Re: getFocus on NSTextField
- From: Enigmarelle Development <email@hidden>
- Date: Wed, 5 Dec 2001 18:19:14 -0500
Sorry, I should have been more clear/thorough in my original message
(shouldn't send email while talking on the phone, watching TV, eating a
sandwich and trying to prevent crumbs from getting into the keyboard.)
It depends on what you need to do. If you want to do something when the
user starts typing into the field, using - (BOOL)control:(NSControl
*)control textShouldBeginEditing:(NSText *)fieldEditor in the field's
delegate or NSControlTextDidBeginEditingNotification might be more
appropriate than acting when the field becomes first responder (gets the
focus).
If you do need to find out when the field first gets focus (ie when the
user clicks or tabs into it) you could subclass it and override
-(BOOL)becomeFirstResponder, do whatever you need to do, and return YES.
See the NSResponder & NSControl documentation.
On Wednesday, December 5, 2001, at 05:20 PM, Kevin Barnd wrote:
I looked through the docs on those objects, but i am still not
understanding what method would tell me when the NSTextField recieves the
focus.
From: Enigmarelle Development <email@hidden>
To: "Kevin Barnd" <email@hidden>
CC: email@hidden
Subject: Re: getFocus on NSTextField
Date: Wed, 5 Dec 2001 14:21:07 -0500
Sorry those are NSTextView messages. For NSTextField you wold use the
equivalent methods from NSControl.h
-john c. warner
enigmarelle development
http://www.enigmarelle.com/