Re: Reloading a preference window settings
Re: Reloading a preference window settings
- Subject: Re: Reloading a preference window settings
- From: Ryan Bates <email@hidden>
- Date: Sun, 7 Mar 2004 15:20:54 -0800
If you call NSWindowController's "window" method before "showWindow",
it should load the window before showing it. You may need to uncheck
"Visible at launch time" in the NSWindow info panel in Interface
Builder as well.
Ryan
On Mar 7, 2004, at 11:04 AM, Steve Palmer wrote:
I have a simple NSWindowController based preference window that is
displayed with:
if (!preferenceController)
preferenceController = [[PreferenceController alloc] init];
[preferenceController showWindow:self];
In the windowDidLoad method, I'm initializing the controls with their
values from the user defaults. The problem is that windowDidLoad is
only called once after the window controller is allocated. If any of
the user defaults are changed elsewhere in the application, the
preferences won't show the new settings.
So - OK. I added:
[preferenceController initializeSettings];
after showWindow to reload the settings via my own initializeSettings
method each time the window is made visible. This works, but there's an
untidy appearance as the values are drawn in after the window is
visible rather than before.
There doesn't seem to be a windowWillBeMadeVisible method in
NSWindowController so I can set the settings there. What is the
recommended way of updating a preference window settings just before it
is being made visible?
_______________________________________________
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.
_______________________________________________
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.