• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: event/notification for focus?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: event/notification for focus?


  • Subject: Re: event/notification for focus?
  • From: Shawn Erickson <email@hidden>
  • Date: Fri, 8 Apr 2005 09:22:35 -0700


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
 _______________________________________________
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

References: 
 >event/notification for focus? (From: Luc Vandal <email@hidden>)
 >Re: event/notification for focus? (From: Mike Ferris <email@hidden>)
 >Re: event/notification for focus? (From: Luc Vandal <email@hidden>)
 >Re: event/notification for focus? (From: Ricky Sharp <email@hidden>)
 >Re: event/notification for focus? (From: Luc Vandal <email@hidden>)
 >Re: event/notification for focus? (From: j o a r <email@hidden>)
 >Re: event/notification for focus? (From: Luc Vandal <email@hidden>)
 >Re: event/notification for focus? (From: j o a r <email@hidden>)
 >Re: event/notification for focus? (From: Luc Vandal <email@hidden>)
 >Re: event/notification for focus? (From: Shawn Erickson <email@hidden>)
 >Re: event/notification for focus? (From: Shawn Erickson <email@hidden>)
 >Re: event/notification for focus? (From: Luc Vandal <email@hidden>)

  • Prev by Date: Re: event/notification for focus?
  • Next by Date: Re: event/notification for focus?
  • Previous by thread: Re: event/notification for focus?
  • Next by thread: Re: event/notification for focus?
  • Index(es):
    • Date
    • Thread