fixed table bug

Thu, 15 May 2014 22:13:25 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Thu, 15 May 2014 22:13:25 +0200
changeset 41
394f3b06dba1
parent 40
caa0df8ed095
child 42
29b2821d1262

fixed table bug

ui/gtk/model.c file | annotate | diff | comparison | revisions
ui/gtk/tree.c file | annotate | diff | comparison | revisions
--- a/ui/gtk/model.c	Thu May 15 21:48:53 2014 +0200
+++ b/ui/gtk/model.c	Thu May 15 22:13:25 2014 +0200
@@ -237,6 +237,7 @@
     //list->current = iter->user_data3;
     if(model->info->getvalue) {
         void *data = model->info->getvalue(iter->user_data3, column);
+        printf("data[%d]: %s\n", column, data);
         ui_model_set_value(model->info->types[column], data, value);
     } else {
         value->g_type = G_TYPE_INVALID;
--- a/ui/gtk/tree.c	Thu May 15 21:48:53 2014 +0200
+++ b/ui/gtk/tree.c	Thu May 15 22:13:25 2014 +0200
@@ -128,13 +128,13 @@
 UIWIDGET ui_table_var(UiObject *obj, UiListPtr *list, UiModelInfo *modelinfo) {
     // create treeview
     GtkWidget *view = gtk_tree_view_new();
-    GtkCellRenderer *renderer = gtk_cell_renderer_text_new();
     for(int i=0;i<modelinfo->columns;i++) {
+        GtkCellRenderer *renderer = gtk_cell_renderer_text_new();
         GtkTreeViewColumn *column = gtk_tree_view_column_new_with_attributes(
                 modelinfo->titles[i],
                 renderer,
                 "text",
-                0,
+                i,
                 NULL);
         gtk_tree_view_column_set_resizable(column, TRUE);
         gtk_tree_view_append_column(GTK_TREE_VIEW(view), column);

mercurial