ui/cocoa/button.m

changeset 1102
c4883a63929b
parent 1101
789b476ff7e3
equal deleted inserted replaced
1101:789b476ff7e3 1102:c4883a63929b
62 62
63 return (__bridge void*)button; 63 return (__bridge void*)button;
64 } 64 }
65 65
66 66
67 static void togglebutton_eventdata(id button, UiVar *var, void **eventdata, int *value) { 67 static void togglebutton_eventdata(id button, UiVar *var, void **eventdata, int *eventdatatype, int *value) {
68 NSButton *btn = (NSButton*)button; 68 NSButton *btn = (NSButton*)button;
69 NSControlStateValue state = btn.state; 69 NSControlStateValue state = btn.state;
70 *value = (int)state; 70 *value = (int)state;
71 } 71 }
72 72
135 135
136 UIWIDGET ui_checkbox_create(UiObject* obj, UiToggleArgs *args) { 136 UIWIDGET ui_checkbox_create(UiObject* obj, UiToggleArgs *args) {
137 return togglebutton_create(obj, args, NSButtonTypeSwitch); 137 return togglebutton_create(obj, args, NSButtonTypeSwitch);
138 } 138 }
139 139
140 static void switch_eventdata(id button, UiVar *var, void **eventdata, int *value) { 140 static void switch_eventdata(id button, UiVar *var, void **eventdata, int *eventdatatype, int *value) {
141 NSSwitch *btn = (NSSwitch*)button; 141 NSSwitch *btn = (NSSwitch*)button;
142 NSControlStateValue state = btn.state; 142 NSControlStateValue state = btn.state;
143 *value = (int)state; 143 *value = (int)state;
144 } 144 }
145 145
205 // NOOP 205 // NOOP
206 } 206 }
207 207
208 @end 208 @end
209 209
210 static void radiobutton_eventdata(id button, UiVar *var, void **eventdata, int *value) { 210 static void radiobutton_eventdata(id button, UiVar *var, void **eventdata, int *eventdatatype, int *value) {
211 if(var) { 211 if(var) {
212 UiInteger *value = var->value; 212 UiInteger *i = var->value;
213 NSMutableArray *buttons = (__bridge NSMutableArray*)value->obj; 213 NSMutableArray *buttons = (__bridge NSMutableArray*)i->obj;
214 for(UiRadioButton *b in buttons) { 214 for(UiRadioButton *b in buttons) {
215 if(b != button) { 215 if(b != button) {
216 b.direct_state = YES; 216 b.direct_state = YES;
217 [[b cell] setState:0]; 217 [[b cell] setState:0];
218 b.direct_state = NO; 218 b.direct_state = NO;

mercurial