• 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: Instantiate custom NSWindow
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Instantiate custom NSWindow


  • Subject: Re: Instantiate custom NSWindow
  • From: glenn andreas <email@hidden>
  • Date: Mon, 24 Sep 2007 14:37:57 -0500


On Sep 24, 2007, at 2:24 PM, Jere Gmail wrote:
By the way, is there any function that is called when the window is
displayed? When I call the runmodal I want some fields on this window
to update with some global variables but as far as I have searched
have only found awakefromnib but not onFocus or something like this.

It isn't the job of the window to update that information, but rather the controller. One would normally make a subclass of NSWindowController for something like this, and implement windowDidLoad (which lets you know that it is ready to be populated with appropriate information, so it will be ready to go when it actually is displayed).


For more obscure needs, you can also set the window's delegate and implement "windowWillDisplay:", but in general, you'll want to work with the Model-View-Controller architecture rather than fight against it by subclassing NSWindow and expecting it to update the information. It may seem odd coming from a non MVC based architecture, but it's the right way to work with Cocoa...


Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
quadrium | flame : flame fractals & strange attractors : build, mutate, evolve, animate




_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Instantiate custom NSWindow (From: "Jere Gmail" <email@hidden>)
 >Re: Instantiate custom NSWindow (From: Fritz Anderson <email@hidden>)
 >Re: Instantiate custom NSWindow (From: "Jere Gmail" <email@hidden>)
 >Re: Instantiate custom NSWindow (From: mmalc crawford <email@hidden>)
 >Re: Instantiate custom NSWindow (From: "Jere Gmail" <email@hidden>)

  • Prev by Date: Re: Instantiate custom NSWindow
  • Next by Date: Re: Best way to programmatically cancel an NSError?
  • Previous by thread: Re: Instantiate custom NSWindow
  • Next by thread: best way to deal with resizable controls that can go to zero?
  • Index(es):
    • Date
    • Thread