ui/motif/menu.c

changeset 2
eeb50c534497
parent 0
1f419bd32da1
child 3
c1a75454b444
equal deleted inserted replaced
1:eb5269000bc8 2:eeb50c534497
276 parent, 276 parent,
277 args, 277 args,
278 2); 278 2);
279 XmStringFree(label); 279 XmStringFree(label);
280 280
281 UiVar *var = uic_getvar(obj, ci->varname); 281 UiVar *var = uic_connect_var(obj->ctx, ci->varname, UI_VAR_INTEGER);
282 if(!var) { 282 if(var) {
283 ui_window_addint(obj, ci->varname);
284 var = uic_getvar(obj, ci->varname);
285 }
286 if(var->type == 1) {
287 UiInteger *value = var->value; 283 UiInteger *value = var->value;
288 value->obj = checkbox; 284 value->obj = checkbox;
289 value->get = ui_toggle_button_get; 285 value->get = ui_toggle_button_get;
290 value->set = ui_toggle_button_set; 286 value->set = ui_toggle_button_set;
291 value = 0; 287 value = 0;
292 } else { 288 } else {
293 // TODO: error message 289 // TODO: error
294 } 290 }
295 } 291 }
296 292
297 293
298 void ui_menu_event_wrapper(Widget widget, XtPointer udata, XtPointer cdata) { 294 void ui_menu_event_wrapper(Widget widget, XtPointer udata, XtPointer cdata) {
299 UiEventData *event = udata; 295 UiEventData *event = udata;
300 UiEvent e; 296 UiEvent e;
301 e.obj = event->obj; 297 e.obj = event->obj;
302 e.window = event->obj->window; 298 e.window = event->obj->window;
303 // TODO: e.document 299 e.document = event->obj->document;
304 e.intval = 0; 300 e.intval = 0;
305 event->callback(&e, event->user_data); 301 event->callback(&e, event->user_data);
306 } 302 }

mercurial