WIP: tree_store.c:217:48: attention: argument 1 de : gtk_tree_view_new_with_model : pointeur incompatible

This commit is contained in:
Jean Sirmai 2023-12-18 12:19:17 +01:00
parent 2f1cd99bfb
commit 3c3f74e46e
Signed by: jean
GPG Key ID: FB3115C340E057E3
1 changed files with 8 additions and 8 deletions

View File

@ -98,7 +98,7 @@ static void create_node (GtkTreeStore *model,
gtk_tree_store_set (model, iter_children, COLUMN_0, item_children->label, -1); gtk_tree_store_set (model, iter_children, COLUMN_0, item_children->label, -1);
} }
static TreeItem create_node_recursive (GtkTreeStore *model, TreeItem *current_item) static GtkTreeStore create_node_recursive (GtkTreeStore *model, TreeItem *current_item)
{ {
TreeItem *item_children; TreeItem *item_children;
GtkTreeIter iter_children, iter_parent; GtkTreeIter iter_children, iter_parent;
@ -113,7 +113,7 @@ static TreeItem create_node_recursive (GtkTreeStore *model, TreeItem *current_it
create_node_recursive (model, item_children); create_node_recursive (model, item_children);
} }
} }
return *item_children; return *model;
} }
static GtkTreeModel * static GtkTreeModel *
@ -183,7 +183,7 @@ do_tree_store (GtkWidget *do_widget)
GtkWidget *sw; GtkWidget *sw;
GtkWidget *treeview; GtkWidget *treeview;
GtkTreeModel *tree_model; GtkTreeModel *tree_model;
GtkTreeStore *tree_store; //GtkTreeStore *tree_store;
/* create window, etc */ /* create window, etc */
window = gtk_window_new (); window = gtk_window_new ();
@ -209,15 +209,15 @@ do_tree_store (GtkWidget *do_widget)
gtk_box_append (GTK_BOX (vbox), sw); gtk_box_append (GTK_BOX (vbox), sw);
/* create tree_model */ /* create tree_model */
//tree_model = create_model (); // GtkTreeStore *model = gtk_tree_store_new (NUM_COLUMNS, G_TYPE_STRING); // tree_model = create_model (); // GtkTreeStore *model = gtk_tree_store_new (NUM_COLUMNS, G_TYPE_STRING);
tree_store = gtk_tree_store_new (NUM_COLUMNS, G_TYPE_STRING); GtkTreeStore tree_store = create_node_recursive (gtk_tree_store_new (NUM_COLUMNS, G_TYPE_STRING), O);
tree_model = create_node_recursive (*tree_store, O); // tree_model = create_node_recursive (tree_store, O);
/* create tree view */ /* create tree view */
treeview = gtk_tree_view_new_with_model (tree_model); treeview = gtk_tree_view_new_with_model (&tree_store);
gtk_widget_set_vexpand (treeview, TRUE); gtk_widget_set_vexpand (treeview, TRUE);
gtk_tree_view_set_reorderable (GTK_TREE_VIEW (treeview), TRUE); gtk_tree_view_set_reorderable (GTK_TREE_VIEW (treeview), TRUE);
g_object_unref (tree_model); g_object_unref (&tree_store);
gtk_tree_selection_set_mode (gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview)), gtk_tree_selection_set_mode (gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview)),
GTK_SELECTION_MULTIPLE); GTK_SELECTION_MULTIPLE);