• 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: [NEWBIE] windowDidBecomeKey ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [NEWBIE] windowDidBecomeKey ?


  • Subject: Re: [NEWBIE] windowDidBecomeKey ?
  • From: Ricky Sharp <email@hidden>
  • Date: Mon, 8 Aug 2005 18:00:39 -0500


On Aug 8, 2005, at 5:15 PM, Stephane Pinel wrote:

Can't figure out in which situation -windowDidBecomeKey delegate will fire ? I've implemented it in
my windowController but it seems to not fire. Any link in order to understand how to do it properly ?

You need to add an observer for NSWindowDidBecomeKeyNotification. You can add the following code in your controller before your window is made key (e.g. automatically or by calling makeKeyWindow or makeKeyAndOrderFront:)


[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowDidBecomeKey:)
name:NSWindowDidBecomeKeyNotification object:theWindow];


[theWindow makeKeyWindow]; // <-- your windowDidBecomeKey: method should then be called.



___________________________________________________________
Ricky A. Sharp         mailto:email@hidden
Instant Interactive(tm)   http://www.instantinteractive.com

_______________________________________________
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


  • Follow-Ups:
    • Re: [NEWBIE] windowDidBecomeKey ?
      • From: mmalcolm crawford <email@hidden>
References: 
 >[NEWBIE] windowDidBecomeKey ? (From: Stephane Pinel <email@hidden>)

  • Prev by Date: Re: Word count and nextWordFromIndex:forward: - not good?
  • Next by Date: [ANN] Typed Stream Viewer
  • Previous by thread: [NEWBIE] windowDidBecomeKey ?
  • Next by thread: Re: [NEWBIE] windowDidBecomeKey ?
  • Index(es):
    • Date
    • Thread