One Quickie


Storing window position in the document (NSDocument->General)
If you want to store the window position in your document, you'll need to store and restore the [window frame] of the window in question. (That's left as an exercise to the reader, based on how you're storing your document contents.) When restoring the window location, you have to turn of NSWindowController's cascading, otherwise it'll honor your width and height, but not your origin. In your document's windowControllerDidLoadNib method, you'll need:
    [[self windowController] setShouldCascadeWindows: NO];

    NSWindow *window;
    window = [self window];
    [window setFrame: loadedWindowBounds display: YES];



borkware home | products | miniblog | rants | quickies | cocoaheads
Advanced Mac OS X Programming book

webmonster@borkware.com