• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Toolbars
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: Toolbars
      • From: Steven Frank <email@hidden>
    • Re: Toolbars
      • From: Steven Frank <email@hidden>
References: 
 >Toolbars (From: Steven Frank <email@hidden>)

  • Prev by Date: Toolbars
  • Next by Date: Re: Toolbars
  • Previous by thread: Toolbars
  • Next by thread: Re: Toolbars
  • Index(es):
    • Date
    • Thread