| 39 button.translatesAutoresizingMaskIntoConstraints = NO; |
40 button.translatesAutoresizingMaskIntoConstraints = NO; |
| 40 if(args->label) { |
41 if(args->label) { |
| 41 NSString *label = [[NSString alloc] initWithUTF8String:args->label]; |
42 NSString *label = [[NSString alloc] initWithUTF8String:args->label]; |
| 42 button.title = label; |
43 button.title = label; |
| 43 } |
44 } |
| |
45 if(args->icon) { |
| |
46 button.image = ui_cocoa_named_icon(args->icon);; |
| |
47 } |
| 44 |
48 |
| 45 if(args->onclick) { |
49 if(args->onclick) { |
| 46 EventData *event = [[EventData alloc] init:args->onclick userdata:args->onclickdata]; |
50 EventData *event = [[EventData alloc] init:args->onclick userdata:args->onclickdata]; |
| 47 event.obj = obj; |
51 event.obj = obj; |
| 48 button.target = event; |
52 button.target = event; |
| 69 //[button setAllowsMixedState:YES]; |
73 //[button setAllowsMixedState:YES]; |
| 70 |
74 |
| 71 if(args->label) { |
75 if(args->label) { |
| 72 NSString *label = [[NSString alloc] initWithUTF8String:args->label]; |
76 NSString *label = [[NSString alloc] initWithUTF8String:args->label]; |
| 73 button.title = label; |
77 button.title = label; |
| |
78 } |
| |
79 if(args->icon) { |
| |
80 button.image = ui_cocoa_named_icon(args->icon); |
| 74 } |
81 } |
| 75 |
82 |
| 76 UiVar* var = uic_widget_var(obj->ctx, obj->ctx, args->value, args->varname, UI_VAR_INTEGER); |
83 UiVar* var = uic_widget_var(obj->ctx, obj->ctx, args->value, args->varname, UI_VAR_INTEGER); |
| 77 if(var) { |
84 if(var) { |
| 78 UiInteger *i = var->value; |
85 UiInteger *i = var->value; |