| 218 if(item->args.icon) { |
218 if(item->args.icon) { |
| 219 button.image = ui_cocoa_named_icon(item->args.icon); |
219 button.image = ui_cocoa_named_icon(item->args.icon); |
| 220 } |
220 } |
| 221 |
221 |
| 222 if(item->args.onclick) { |
222 if(item->args.onclick) { |
| 223 EventData *event = [[EventData alloc] init:item->args.onclick userdata:item->args.onclickdata]; |
223 EventData *event = [[EventData alloc] init:item->args.onclick userdata:item->args.onclickdata action:item->args.action]; |
| 224 event.obj = obj; |
224 event.obj = obj; |
| 225 button.target = event; |
225 button.target = event; |
| 226 button.action = @selector(handleEvent:); |
226 button.action = @selector(handleEvent:); |
| 227 objc_setAssociatedObject(button, "eventdata", event, OBJC_ASSOCIATION_RETAIN); |
227 objc_setAssociatedObject(button, "eventdata", event, OBJC_ASSOCIATION_RETAIN); |
| 228 } |
228 } |