| 130 gtk_menu_shell_append(GTK_MENU_SHELL(parent), widget); |
130 gtk_menu_shell_append(GTK_MENU_SHELL(parent), widget); |
| 131 |
131 |
| 132 if(i->groups) { |
132 if(i->groups) { |
| 133 CxList *groups = cxArrayListCreateSimple(sizeof(int), i->ngroups); |
133 CxList *groups = cxArrayListCreateSimple(sizeof(int), i->ngroups); |
| 134 cxListAddArray(groups, i->groups, i->ngroups); |
134 cxListAddArray(groups, i->groups, i->ngroups); |
| 135 uic_add_group_widget(obj->ctx, widget, (ui_enablefunc)ui_set_enabled, groups); |
135 uic_add_state_widget(obj->ctx, widget, (ui_enablefunc)ui_set_enabled, groups); |
| 136 cxListFree(groups); |
136 cxListFree(groups); |
| 137 } |
137 } |
| 138 } |
138 } |
| 139 |
139 |
| 140 void add_menuseparator_widget( |
140 void add_menuseparator_widget( |
| 460 |
460 |
| 461 GSimpleAction *action = g_simple_action_new(item->id, NULL); |
461 GSimpleAction *action = g_simple_action_new(item->id, NULL); |
| 462 g_action_map_add_action(obj->ctx->action_map, G_ACTION(action)); |
462 g_action_map_add_action(obj->ctx->action_map, G_ACTION(action)); |
| 463 g_object_unref(action); |
463 g_object_unref(action); |
| 464 |
464 |
| 465 if(i->groups) { |
465 if(i->states) { |
| 466 CxList *groups = cxArrayListCreateSimple(sizeof(int), i->ngroups); |
466 CxList *groups = cxArrayListCreateSimple(sizeof(int), i->nstates); |
| 467 cxListAddArray(groups, i->groups, i->ngroups); |
467 cxListAddArray(groups, i->states, i->nstates); |
| 468 uic_add_group_widget(obj->ctx, action, (ui_enablefunc)action_enable, groups); |
468 uic_add_state_widget(obj->ctx, action, (ui_enablefunc)action_enable, groups); |
| 469 cxListFree(groups); |
469 cxListFree(groups); |
| 470 } |
470 } |
| 471 |
471 |
| 472 if(i->callback != NULL) { |
472 if(i->callback != NULL) { |
| 473 UiEventData *event = malloc(sizeof(UiEventData)); |
473 UiEventData *event = malloc(sizeof(UiEventData)); |