Saving Window Frame

  • As always, thanks in advance.

    I am having difficulty in getting a NSWindowController subclass to save
    its frame from launch to launch. I have managed to confuse myself quite
    a bit.

    A little background, I have three different NSWindowController window
    subclasses (a Terminal, a Preferences window and a Commands window.

    In the the Preferences  NSWindowController subclass I use have this
    line of code in the init:

      [self setWindowFrameAutosaveName:@"Preferences"];

    and it does indeed save its frame from launch to launch. This subclass
    does not implement a windowShouldClose delegate method.

    In my Commands NSWindowController subclass (in which I do implement a
    windowShouldClose delegate) that

    method will not work. Instead I have (in the init when the window has
    not yet been loaded) the following command:

      [[self window] setFrameUsingName:@"RESWindow"];

    and in the windowShouldClose method the following command:

    [[self window] saveFrameUsingName:@"RESWindow"];

    and this works retaining the window frame from launch to launch.

    My problem is in my Terminal NSWindowController subclass neither of
    these methods work!

    I have checked the pList, the frames are indeed being saved to the
    user's prefs.

    Can anyone educate me on this?

    Tom Gray
    cocoa-dev mailing list | <cocoa-dev...>
    Do not post admin requests to the list. They will be ignored.
previous month january 2003 next month
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    
Go to today