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
|
Showing messages 1 through 2 of 2.
-
Customize menu item disabled
2002-04-06 03:28:17
zeus
[View]
-
Customize menu item disabled
2002-04-07 12:33:53
michele
[View]
and God should learn reading before posting stupid thread.
But now that everything should work I get a stupid:"AddressBook.app has exited due to signal 10 (SIGBUS)."or "AddressBook.app has exited due to signal 11 (SIGSEGV)." It depends on where I put my [self setupToolbar] in the awakeFromNib method.
CU Jerome