ui/gtk/button.c

changeset 115
e57ca2747782
parent 112
c3f2f16fa4b8
--- a/ui/gtk/button.c	Sun Dec 07 20:00:33 2025 +0100
+++ b/ui/gtk/button.c	Sat Dec 13 15:58:58 2025 +0100
@@ -106,7 +106,7 @@
 UIWIDGET ui_button_create(UiObject *obj, UiButtonArgs *args) {
     GtkWidget *button = ui_create_button(obj, args->label, args->icon, args->tooltip, args->onclick, args->onclickdata, 0, FALSE);
     ui_set_name_and_style(button, args->name, args->style_class);
-    ui_set_widget_groups(obj->ctx, button, args->groups);
+    ui_set_widget_states(obj->ctx, button, args->states);
     UiContainerPrivate *ct = (UiContainerPrivate*)obj->container_end;
     UiLayout layout = UI_ARGS2LAYOUT(args);
     ct->add(ct, button, &layout);
@@ -174,9 +174,9 @@
 
 static void ui_togglebutton_enable_state_callback(GtkToggleButton *widget, UiEventData *event) {
     if(gtk_toggle_button_get_active(widget)) {
-        ui_set_group(event->obj->ctx, event->value);
+        ui_set_state(event->obj->ctx, event->value);
     } else {
-        ui_unset_group(event->obj->ctx, event->value);
+        ui_unset_state(event->obj->ctx, event->value);
     }
 }
 
@@ -308,9 +308,9 @@
             args->value,
             args->onchange,
             args->onchangedata,
-            args->enable_group);
+            args->enable_state);
     ui_set_name_and_style(widget, args->name, args->style_class);
-    ui_set_widget_groups(obj->ctx, widget, args->groups);
+    ui_set_widget_states(obj->ctx, widget, args->states);
     
     UiContainerPrivate *ct = (UiContainerPrivate*)obj->container_end;
     UiLayout layout = UI_ARGS2LAYOUT(args);
@@ -351,9 +351,9 @@
 
 static void ui_checkbox_enable_state(GtkCheckButton *widget, UiEventData *event) {
     if(gtk_check_button_get_active(widget)) {
-        ui_set_group(event->obj->ctx, event->value);
+        ui_set_state(event->obj->ctx, event->value);
     } else {
-        ui_unset_group(event->obj->ctx, event->value);
+        ui_unset_state(event->obj->ctx, event->value);
     }
 }
 
@@ -370,10 +370,10 @@
             args->onchange,
             args->onchangedata,
             (ui_toggled_func)ui_checkbox_enable_state,
-            args->enable_group);
+            args->enable_state);
     
     ui_set_name_and_style(widget, args->name, args->style_class);
-    ui_set_widget_groups(obj->ctx, widget, args->groups);
+    ui_set_widget_states(obj->ctx, widget, args->states);
     
     UiContainerPrivate *ct = (UiContainerPrivate*)obj->container_end;
     UiLayout layout = UI_ARGS2LAYOUT(args);
@@ -419,7 +419,7 @@
 UIWIDGET ui_switch_create(UiObject* obj, UiToggleArgs *args) {
     GtkWidget *widget = gtk_switch_new();
     ui_set_name_and_style(widget, args->name, args->style_class);
-    ui_set_widget_groups(obj->ctx, widget, args->groups);
+    ui_set_widget_states(obj->ctx, widget, args->states);
     
     UiVar* var = uic_widget_var(obj->ctx, obj->ctx, args->value, args->varname, UI_VAR_INTEGER);
     if(var) {
@@ -541,7 +541,7 @@
     
     GtkWidget *rbutton = RADIOBUTTON_NEW(rg, args->label); 
     ui_set_name_and_style(rbutton, args->name, args->style_class);
-    ui_set_widget_groups(obj->ctx, rbutton, args->groups);
+    ui_set_widget_states(obj->ctx, rbutton, args->states);
     if(rgroup) {
 #if GTK_MAJOR_VERSION >= 4
         if(rg) {
@@ -895,7 +895,7 @@
     }
     
     ui_set_name_and_style(button, args->name, args->style_class);
-    ui_set_widget_groups(obj->ctx, button, args->groups);
+    ui_set_widget_states(obj->ctx, button, args->states);
     UiContainerPrivate *ct = (UiContainerPrivate*)obj->container_end;
     UiLayout layout = UI_ARGS2LAYOUT(args);
     ct->add(ct, button, &layout);

mercurial