Re: setFrameAutosaveName question
Re: setFrameAutosaveName question
- Subject: Re: setFrameAutosaveName question
- From: Darkshadow <email@hidden>
- Date: Thu, 11 Mar 2004 18:50:24 -0500
On Mar 11, 2004, at 1:52 PM, Darrin Cardani wrote:
It could be the cascading feature... try setting
-setShouldCascadeWindows: to NO in the window controllers' init methods
as well.
At 8:21 PM -0500 3/10/04, Darkshadow wrote:
The window controllers are overriding that - when you create a new
window controller, it automatically sets the autosave name to @"".
From the NSWindowController reference:
---------------------------------------------
initWithWindowNibName:
- (id)initWithWindowNibName:(NSString *)windowNibName
...The default initialization turns on cascading, sets the
shouldCloseDocument flag to NO, and sets the autosave name for the
window's frame to an empty string.
----------------------------------------------
(Note that all of the init methods set the autosave name to an empty
string).
Doesn't that defeat the point of having an autosave name in the nib
file? I guess you could use it for sheets and stuff that don't have
window controllers, but it seems like your most import windows where
you would want it the most will have window controllers.
But, NSWindowController also has a way to reset the autoframe name
(though you'll have to do it manually):
---------------------------------------------
setWindowFrameAutosaveName:
- (void)setWindowFrameAutosaveName:(NSString *)name
Sets the name under which the window's frame (its size and location
on the screen) is saved in the defaults database. By default, name is
an empty string, causing no information to be stored in the defaults
database.
---------------------------------------------
I've done this and I'm seeing some weird results. It works completely
for 1 window, but not for the other 3 windows. In the window it works
for, I'm calling:
[ self setWindowFrameAutosaveName:kFrameName_Timeline ];
in the -initWithWindowNibName: method. Then, in my document's
-windowControllerDidLoadNib: method, I call:
[ timelineWindow setFrameUsingName:kFrameName_Timeline ];
I do the same thing for the other 3 windows, yet they show the
behavior from before. The position and size get saved for 1 run, then
are erased on the next run. I don't understand why it works in one
case and not the others. What am I doing wrong?
Thanks,
Darrin
--
Darrin Cardani - email@hidden
President, Buena Software, Inc.
<http://www.buena.com/>
Video, Image and Audio Processing Development
_______________________________________________
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.