diff -r 2dbc56c2323b -r e2fd132ab781 ui/cocoa/toolbar.m --- a/ui/cocoa/toolbar.m Sat Mar 29 19:12:07 2014 +0100 +++ b/ui/cocoa/toolbar.m Mon Mar 31 20:22:16 2014 +0200 @@ -31,6 +31,7 @@ #import #import "toolbar.h" +#import "stock.h" static UiToolbarDelegate* toolbar_delegate; @@ -55,22 +56,17 @@ - (NSToolbarItem *) createItem:(NSToolbar*)toolbar identifier:(NSString*)identifier { - /* UiStockItem *s = ui_get_stock_item(stockid); if(s == nil) { printf("cannot find stock item\n"); return nil; } - if([s buttonImage] == nil && [s itemImage] == nil) { - return nil; - } - */ NSToolbarItem *item = [[[NSToolbarItem alloc] initWithItemIdentifier: identifier] autorelease]; //[item setLabel:[s label]]; //[item setPaletteLabel:[s label]]; - [item setLabel:@"Add"]; + [item setLabel:s->label]; [item setPaletteLabel:@"Operation"]; // create button ... @@ -78,7 +74,12 @@ //NSSearchField *sf = [[NSSearchField alloc]initWithFrame:frame]; NSButton *button = [[NSButton alloc]initWithFrame:frame]; //[button setImage:[s buttonImage]]; - [button setImage:[NSImage imageNamed: NSImageNameAddTemplate]]; + //[button setImage:[NSImage imageNamed: NSImageNameAddTemplate]]; + if(s->image) { + [button setImage:s->image]; + } else { + [button setImage:[NSImage imageNamed: NSImageNameRemoveTemplate]]; + } [button setBezelStyle: NSTexturedRoundedBezelStyle]; [item setView:button];