Re: event/notification for focus?
Re: event/notification for focus?
- Subject: Re: event/notification for focus?
- From: Luc Vandal <email@hidden>
- Date: Fri, 08 Apr 2005 12:29:45 -0400
Basically there's a text field, check boxes, radio buttons and buttons. Like I said, makeFirstResponder is called every time I tab through the controls but the notification is only received once, when the window has closed.
[center addObserver:self
selector:@selector(windowUpdated:)
name:NSWindowDidUpdateNotification object:nil];
- (void)windowUpdated:(NSNotification*)notification
{
NSResponder* resp = [[self window] firstResponder];
if( resp != m_resp )
{
m_resp = resp;
}
}
The only problem is that resp is always null. Where should I get the firstResponder instead?
You sure [self window] is returning a window reference and not nil?
Also is the window returned the active window (not sure without digging in docs if firstResponder is expected return no nil for deactivated windows, etc.)
What is self here, what class of object?
Actually that code is no good anymore...
On 8-Apr-05, at 12:18 PM, Shawn Erickson wrote:
On Apr 8, 2005, at 9:06 AM, Luc Vandal wrote:
Hi!
that seems to work great! However, I only get the notification once the window has closed. Shouldn't I receive the notification every time the first responder changes? makeFirstResponder is called every time and sends the notification but the breakpoint I added in my function is only triggered once...
Can you explain what is in your window?
-Shawn
_______________________________________________
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