Toolbars
Toolbars
- Subject: Toolbars
- From: Steven Frank <email@hidden>
- Date: Fri, 28 Sep 2001 15:17:03 -0700
Hello,
I'm trying to add a toolbar to a document-oriented app. I thought I was
following the sample code pretty much exactly, but the sample code works
and mine doesn't.
In my NSDocument subclass, I have this:
- (void)windowControllerDidLoadNib:(NSWindowController*)inController
//
// Add any code here that need to be executed once the windowController
// has loaded the document's window.
//
{
NSWindow* theWindow;
[super windowControllerDidLoadNib:inController];
toolbarItems = [[NSMutableDictionary alloc] init];
toolbar = [[[NSToolbar alloc] initWithIdentifier:@"DocToolbar"]
autorelease];
[toolbar setAllowsUserCustomization:YES];
[toolbar setAutosavesConfiguration:YES];
[toolbar setDisplayMode:NSToolbarDisplayModeIconAndLabel];
[toolbar setDelegate:self];
theWindow = [inController window];
[theWindow setToolbar:toolbar];
}
I also have all the delegate functions that are "required" according to
the NSToolbar docs. However, I've set breakpoints on the first line of
ALL the NSToolbar delegate functions, and they are never called.
Needless to say, my toolbar never shows up in the window.
I'm going crazy here. Please help. Thanks,
Steven