diff -r eb5269000bc8 -r eeb50c534497 ui/motif/menu.c --- a/ui/motif/menu.c Sun Dec 08 11:20:41 2013 +0000 +++ b/ui/motif/menu.c Fri Mar 21 13:20:53 2014 +0100 @@ -278,19 +278,15 @@ 2); XmStringFree(label); - UiVar *var = uic_getvar(obj, ci->varname); - if(!var) { - ui_window_addint(obj, ci->varname); - var = uic_getvar(obj, ci->varname); - } - if(var->type == 1) { + UiVar *var = uic_connect_var(obj->ctx, ci->varname, UI_VAR_INTEGER); + if(var) { UiInteger *value = var->value; value->obj = checkbox; value->get = ui_toggle_button_get; value->set = ui_toggle_button_set; value = 0; } else { - // TODO: error message + // TODO: error } } @@ -300,7 +296,7 @@ UiEvent e; e.obj = event->obj; e.window = event->obj->window; - // TODO: e.document + e.document = event->obj->document; e.intval = 0; event->callback(&e, event->user_data); }