Re: Toolbars
Re: Toolbars
- Subject: Re: Toolbars
- From: "John C. Randolph" <email@hidden>
- Date: Fri, 28 Sep 2001 15:58:26 -0700
On Friday, September 28, 2001, at 03:17 PM, Steven Frank wrote:
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];
}
Have you confirmed that -windowControllerDidLoadNib: is getting called,
and that [inController window] is returning a valid NSWindow reference?
If that connection got broken in IB, that would explain the symptom.
-jcr
"I fear all we have done is to awaken a sleeping giant and fill him with
a terrible resolve." -Admiral Isoroku Yamamoto, Dec 7, 1941.
References: | |
| >Toolbars (From: Steven Frank <email@hidden>) |