One Quickie

Getting a document's window (NSDocument->General)
For 10.3 and later systems, use -windowForSheet (which doesn't tell you the window associated with a particular sheet, but instead returns the window to be used for showing sheets, which is usually what you want when talking about the document's window - Thanks to Peter Hosey for this one).

For folks stuck in 10.2 land, or who want to do it themselves, there's always this:

- (NSWindow *) window
    NSArray *windowControllers;
    windowControllers = [self windowControllers];

    NSWindowController *controller;
    controller = [windowControllers objectAtIndex: 0];

    NSWindow *window;
    window = [controller window];

    return (window);

} // window

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