| 690 } |
690 } |
| 691 ui_button_set_icon_name(widget, icon); |
691 ui_button_set_icon_name(widget, icon); |
| 692 gtk_widget_set_tooltip_text(widget, tooltip); |
692 gtk_widget_set_tooltip_text(widget, tooltip); |
| 693 button->widget = widget; |
693 button->widget = widget; |
| 694 |
694 |
| |
695 if(args->action) { |
| |
696 uic_bind_action(obj->ctx, args->action, widget, (ui_enablefunc)ui_set_enabled); |
| |
697 UiAction *ui_action = uic_resolve_action(obj->ctx, args->action); |
| |
698 if(!ui_action) { |
| |
699 ui_set_enabled(widget, FALSE); |
| |
700 } |
| |
701 } |
| |
702 |
| 695 if(args->toggled_by_state != 0) { |
703 if(args->toggled_by_state != 0) { |
| 696 CxList *ls = cxArrayListCreate(NULL, sizeof(int), 1); |
704 CxList *ls = cxArrayListCreate(NULL, sizeof(int), 1); |
| 697 cxListAdd(ls, &args->toggled_by_state); |
705 cxListAdd(ls, &args->toggled_by_state); |
| 698 uic_add_state_widget(obj->ctx, button, ui_content_togglebutton_enabled_by_state, ls); |
706 uic_add_state_widget(obj->ctx, button, ui_content_togglebutton_enabled_by_state, ls); |
| 699 cxListFree(ls); |
707 cxListFree(ls); |