111 |
112 |
112 NSMenuItem *item = [currentMenu addItemWithTitle:str |
113 NSMenuItem *item = [currentMenu addItemWithTitle:str |
113 action:@selector(handleEvent:) keyEquivalent:@""]; |
114 action:@selector(handleEvent:) keyEquivalent:@""]; |
114 [item setTarget:event]; |
115 [item setTarget:event]; |
115 |
116 |
116 //[delegate addItem: item]; |
117 currentItemIndex++; |
|
118 } |
|
119 |
|
120 void ui_menuitem_st(char *stockid, ui_callback f, void *data) { |
|
121 EventWrapper *event = [[EventWrapper alloc]initWithData:data callback:f]; |
|
122 UiStockItem *si = ui_get_stock_item(stockid); |
|
123 |
|
124 NSMenuItem *item = [currentMenu addItemWithTitle:si->label |
|
125 action:@selector(handleEvent:) keyEquivalent:si->keyEquivalent]; |
|
126 [item setTarget:event]; |
|
127 |
117 currentItemIndex++; |
128 currentItemIndex++; |
118 } |
129 } |
119 |
130 |
120 void ui_checkitem(char *label, ui_callback f, void *data) { |
131 void ui_checkitem(char *label, ui_callback f, void *data) { |
121 EventWrapper *event = [[EventWrapper alloc]initWithData:data callback:f]; |
132 EventWrapper *event = [[EventWrapper alloc]initWithData:data callback:f]; |