advertisement

Article:
  Creating Toolbars for Mac OS X
Subject:   Customize menu item disabled
Date:   2002-04-05 18:41:52
From:   michele
Response to: Customize menu item disabled

Hello Zeus (my God!:-),


It's perfectly normal that the item is disabled in Interface Builder as the toolbar is not initialized.


In your code, in Controller.m, you have to set up the toolbar.


in awakeFromNib:


[self setUpToolbar];


and then add the following method in Controller.m:


- (void) setupToolbar
{
NSToolbar *toolbar = [[[NSToolbar alloc] initWithIdentifier: @"mainToolbar"] autorelease];
[toolbar setDelegate: self];
[toolbar setAllowsUserCustomization: YES];
[toolbar setAutosavesConfiguration: YES];
[mainWindow setToolbar: toolbar];
}


In controller.h , declare it:


- (void) setupToolbar;


And don't omit to implement the toolbar category.


Hope this helps you,
Michèle


1 to 1 of 1
  1. Customize menu item disabled
    2002-04-06 03:28:17  zeus [View]

    • Customize menu item disabled
      2002-04-07 12:33:53  michele [View]

1 to 1 of 1