Re: delegate method first responder
Re: delegate method first responder
- Subject: Re: delegate method first responder
- From: Dustin Voss <email@hidden>
- Date: Tue, 30 Mar 2004 15:00:39 -0800
On 30 Mar, 2004, at 12:30 PM, Morphine wrote:
I've a very simple question... but I don't find the answer.
How to know when the first reponder change ? A delegate method exists ?
I can know what is the first responder object (with firstresponder
method) but I'd like to be informed when the focus change.
Thank you very much for this newbie question.
There is no built-in way. You need to make a sub-class of NSWindow and
override -makeFirstResponder:. The override should call super's
-makeFirstResponder: and post a notification or call a delegate method.
Post the notification via the notification queue with a posting style
of NSPostASAP. Call the delegate method with
-performSelector:withObject:afterDelay:0.
This will give the OS time to finish changing the first responder;
there's still more to do after -makeFirstResponder: gets called.
_______________________________________________
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.