diff -r 06be29a56f8b -r f8f22eb0b575 ui/cocoa/menu.m --- a/ui/cocoa/menu.m Wed Apr 02 09:59:38 2014 +0200 +++ b/ui/cocoa/menu.m Wed Apr 02 13:21:11 2014 +0200 @@ -32,6 +32,7 @@ #import "menu.h" #import "window.h" +#import "stock.h" @implementation UiMenuDelegate @@ -113,7 +114,17 @@ action:@selector(handleEvent:) keyEquivalent:@""]; [item setTarget:event]; - //[delegate addItem: item]; + currentItemIndex++; +} + +void ui_menuitem_st(char *stockid, ui_callback f, void *data) { + EventWrapper *event = [[EventWrapper alloc]initWithData:data callback:f]; + UiStockItem *si = ui_get_stock_item(stockid); + + NSMenuItem *item = [currentMenu addItemWithTitle:si->label + action:@selector(handleEvent:) keyEquivalent:si->keyEquivalent]; + [item setTarget:event]; + currentItemIndex++; }