Re: Instantiate custom NSWindow
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