WIP: tree_model = create_node_recursive ((GtkTreeModel) tree_store, O); << pb de casting ?

This commit is contained in:
Jean Sirmai 2023-12-18 10:17:55 +01:00
parent 5e870ae870
commit 3430bd25fe
Signed by: jean
GPG Key ID: FB3115C340E057E3
1 changed files with 8 additions and 5 deletions

View File

@ -182,7 +182,8 @@ do_tree_store (GtkWidget *do_widget)
GtkWidget *vbox; GtkWidget *vbox;
GtkWidget *sw; GtkWidget *sw;
GtkWidget *treeview; GtkWidget *treeview;
GtkTreeModel *model; GtkTreeModel *tree_model;
GtkTreeStore *tree_store;
/* create window, etc */ /* create window, etc */
window = gtk_window_new (); window = gtk_window_new ();
@ -207,14 +208,16 @@ do_tree_store (GtkWidget *do_widget)
GTK_POLICY_AUTOMATIC); GTK_POLICY_AUTOMATIC);
gtk_box_append (GTK_BOX (vbox), sw); gtk_box_append (GTK_BOX (vbox), sw);
/* create model */ /* create tree_model */
model = create_model (); tree_model = create_model ();
// tree_store = gtk_tree_store_new (NUM_COLUMNS, G_TYPE_STRING);
// tree_model = create_node_recursive ((GtkTreeModel) tree_store, O);
/* create tree view */ /* create tree view */
treeview = gtk_tree_view_new_with_model (model); treeview = gtk_tree_view_new_with_model (tree_model);
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 (model); g_object_unref (tree_model);
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);