Newbie NSToolbar question?
Newbie NSToolbar question?
- Subject: Newbie NSToolbar question?
- From: Mark Munz <email@hidden>
- Date: Fri, 17 Oct 2003 17:53:41 -0600
Hi guys,
I'm trying to setup a toolbar on a document based application.
So I wrote a Category
@interface Document (ToolbarDelegateCategory)
- (NSToolbarItem *) toolbar: (NSToolbar *)toolbar
itemForItemIndentifier:(NSString *)itemIdentifier
willBeInsertedIntoToolbar: (BOOL)flag;
- (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar*)toolbar;
- (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar*)toolbar;
- (void)setupToolbar:(NSWindow*)theWindow;
@end
...
{ implementation of three delegate methods }
- (void)setupToolbar:(NSWindow*)theWindow
{
NSToolbar *toolbar = [ [NSToolbar alloc]
initWithIdentifier:@"document_toolbar"];
[toolbar autorelease];
[toolbar setDelegate:self];
[toolbar setAllowsUserCustomization:YES];
[toolbar setAutosavesConfiguration:YES];
[[self window] setToolbar:toolbar];
}
The problem is when setDelegate gets called, I get the following warning
(and then I don't get my toolbar (it draws empty)):
2003-10-17 17:42:15.309 MyApp[3048] ERROR: invalid delegate <Document:
0x2100000> (does not implement all required methods), and so can not be
used!
As far as I can tell, the three methods implemented are the only required
ones for NSToolbar. Am I missing something very obvious? Is there any way I
can figure out which method wasn't implemented?
Thanks for any help anyone can give on this.
Mark Munz
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.