Re: what method is called when window is re-loaded?
Re: what method is called when window is re-loaded?
- Subject: Re: what method is called when window is re-loaded?
- From: Christopher Corbell <email@hidden>
- Date: Fri, 6 Feb 2004 02:05:46 -0800
On Feb 5, 2004, at 10:14 PM, Amit Sadana wrote:
I have a non - modal window and I want to display new data into it
whenever it get's loaded through the menu, but not when it becomes
active after remaining open in the background. The problem is where
exactly to load the data - awakeFromNib/init get called only for the
first time. I tried windowDidBecomeMain but it gets called even if the
window becomes current window after remaining open in the background.
Is there any way I can know that the window has been loaded again and
was not present among the open windows?
Thanks
-Amit
_______________________________________________
If it gets loaded through a menu, then there's an action that's
invoked in your code to load it, right?
Just add a method to reload its data, and call it when the
menu action is invoked, before showing the window. If you need
to make sure that the window is being shown and not merely
brought forward, just test it to see if it's visible. Or set a flag in
the controller when the window closes that indicates its data
needs to be reloaded.
hth,
Chris
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.