• 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: setFrameAutosaveName question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >setFrameAutosaveName question (From: Darrin Cardani <email@hidden>)
 >Re: setFrameAutosaveName question (From: Darkshadow <email@hidden>)
 >Re: setFrameAutosaveName question (From: Darrin Cardani <email@hidden>)

  • Prev by Date: Re: creating files to write data to?
  • Next by Date: Re: how to import an eps file in Interface Builder
  • Previous by thread: Re: setFrameAutosaveName question
  • Next by thread: How to get at argc/argv?
  • Index(es):
    • Date
    • Thread