fix int columns in gtk3 tables

Mon, 13 Jan 2025 22:50:38 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Mon, 13 Jan 2025 22:50:38 +0100
changeset 445
5059f2435775
parent 444
0a52c26bba1a
child 446
535089a269c8

fix int columns in gtk3 tables

application/main.c file | annotate | diff | comparison | revisions
ui/gtk/list.c file | annotate | diff | comparison | revisions
--- a/application/main.c	Mon Jan 13 22:47:44 2025 +0100
+++ b/application/main.c	Mon Jan 13 22:50:38 2025 +0100
@@ -413,6 +413,7 @@
         }
         ui_tab(obj, "Tab 1") {
             UiModel *model = ui_model(obj->ctx, UI_STRING, "col1", UI_INTEGER, "col2", UI_ICON, "col3", UI_ICON_TEXT, "col4", UI_INTEGER, "col5", -1);
+            model->columnsize[0] = -1;
             model->getvalue = table_getvalue;
             ui_table(obj, .model = model, .list = doc->list2, .colspan = 2, .fill = UI_ON, .contextmenu = menubuilder, .multiselection = TRUE,
                     .onactivate = action_table_activate, .onactivatedata = "activate",
--- a/ui/gtk/list.c	Mon Jan 13 22:47:44 2025 +0100
+++ b/ui/gtk/list.c	Mon Jan 13 22:50:38 2025 +0100
@@ -614,8 +614,8 @@
                     }
                     case UI_INTEGER: {
                         g_value_init(&value, G_TYPE_INT);
-                        int *intptr = data;
-                        g_value_set_int(&value, *intptr);
+                        intptr_t intptr = (intptr_t)data;
+                        g_value_set_int(&value, (int)intptr);
                         break;
                     }
                     case UI_ICON: {

mercurial