ui/gtk/button.c

branch
newapi
changeset 344
870dd3d41d83
parent 343
54f5d7eb1335
--- a/ui/gtk/button.c	Tue Oct 22 21:17:01 2024 +0200
+++ b/ui/gtk/button.c	Wed Oct 23 14:52:18 2024 +0200
@@ -59,7 +59,8 @@
         const char *label,
         const char *icon,
         ui_callback onclick,
-        void *userdata)
+        void *userdata,
+        int event_value)
 {
     GtkWidget *button = gtk_button_new_with_label(label);
     ui_button_set_icon_name(button, icon);
@@ -69,7 +70,7 @@
         event->obj = obj;
         event->userdata = userdata;
         event->callback = onclick;
-        event->value = 0;
+        event->value = event_value;
         event->customdata = NULL;
 
         g_signal_connect(
@@ -89,7 +90,7 @@
 
 UIWIDGET ui_button_create(UiObject *obj, UiButtonArgs args) {
     UiObject* current = uic_current_obj(obj);
-    GtkWidget *button = ui_create_button(obj, args.label, args.icon, args.onclick, args.onclickdata);
+    GtkWidget *button = ui_create_button(obj, args.label, args.icon, args.onclick, args.onclickdata, 0);
     ui_set_name_and_style(button, args.name, args.style_class);
     ui_set_widget_groups(obj->ctx, button, args.groups);
     UI_APPLY_LAYOUT1(current, args);

mercurial