One Quickie


Using a custom title for NSWindowController windows (NSDocument->NSWindow)
When using utility windows in a document-based app, NSWindowController is handy for handling a lot of the grungy details. When using a shared window (like an inspector window), you want its title to reflect that of the document. Override windowTitleForDocumentDisplayName to set the title. In this case, it becomes of the form "Overview of Untitled 2":
- (NSString *) windowTitleForDocumentDisplayName: (NSString *) displayName
{
    NSString *string;
    string = [NSString stringWithFormat: @"Overview of %@", displayName];

    return (string);

} // windowTitleForDocumentDisplayName



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

webmonster@borkware.com