Skip navigation.
 
mlRe: event/notification for focus?
FROM : Shawn Erickson
DATE : Fri Apr 08 18:22:35 2005

On Apr 7, 2005, at 1:02 PM, Luc Vandal wrote:

> [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?

-Shawn

Related mailsAuthorDate
mlevent/notification for focus? Luc Vandal Apr 6, 20:57
mlRe: event/notification for focus? Ricky Sharp Apr 6, 21:58
mlRe: event/notification for focus? ttempel Apr 7, 00:48
mlRe: event/notification for focus? Luc Vandal Apr 7, 01:58
mlRe: event/notification for focus? Dustin Voss Apr 7, 02:22
mlRe: event/notification for focus? Mike Ferris Apr 7, 16:41
mlRe: event/notification for focus? Luc Vandal Apr 7, 17:50
mlRe: event/notification for focus? Ricky Sharp Apr 7, 17:58
mlRe: event/notification for focus? Luc Vandal Apr 7, 18:26
mlRe: event/notification for focus? j o a r Apr 7, 18:36
mlRe: event/notification for focus? Shawn Erickson Apr 7, 18:41
mlRe: event/notification for focus? Luc Vandal Apr 7, 18:46
mlRe: event/notification for focus? j o a r Apr 7, 18:51
mlRe: event/notification for focus? Luc Vandal Apr 7, 19:07
mlRe: event/notification for focus? Ricky Sharp Apr 7, 19:15
mlRe: event/notification for focus? Shawn Erickson Apr 7, 19:29
mlRe: event/notification for focus? Shawn Erickson Apr 7, 20:48
mlRe: event/notification for focus? Luc Vandal Apr 7, 22:02
mlRe: event/notification for focus? Luc Vandal Apr 8, 18:06
mlRe: event/notification for focus? Shawn Erickson Apr 8, 18:18
mlRe: event/notification for focus? Shawn Erickson Apr 8, 18:22
mlRe: event/notification for focus? Luc Vandal Apr 8, 18:29
mlRe: event/notification for focus? Shawn Erickson Apr 8, 18:43
mlRe: event/notification for focus? Luc Vandal Apr 8, 18:46
mlRe: event/notification for focus? Luc Vandal Apr 8, 19:17
mlRe: event/notification for focus? Shawn Erickson Apr 8, 19:33
mlRe: event/notification for focus? Luc Vandal Apr 8, 21:35
mlRe: event/notification for focus? Shawn Erickson Apr 8, 21:45