WIP: (gtk4-demo:18707): GLib-GIO-CRITICAL **: g_list_store_insert: assertion 'G_IS_LIST_STORE (store)' failed

This commit is contained in:
Jean Sirmai 2023-12-27 22:38:06 +01:00
parent e9ef7fbeae
commit b8fa3b1704
Signed by: jean
GPG Key ID: FB3115C340E057E3
1 changed files with 9 additions and 1 deletions

View File

@ -26,7 +26,6 @@
/* _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ */
/* _ _ _ _ _ _ _ _ _ _ _ _ _ _ T R E E _ _ _ _ _ _ _ _ _ _ _ _ _ _ */
/* https://docs.gtk.org/gtk4/ */
/* https://docs.gtk.org/gtk4/section-tree-widget.html */
/* https://docs.gtk.org/gtk4/section-list-widget.html << (see below the "quick comparison chart of equivalent functionalities") */
/* https://docs.gtk.org/gtk4/class.TreeListModel.html */
/* */
@ -319,6 +318,15 @@ do_tree_store (GtkWidget *do_widget)
GtkTreeStore *my_tree_store = NULL; /////
GtkTreeListModel *my_tree_list_model;
char *my_str_data = "A";
GListStore *my_g_list_store = g_list_store_new (my_str_data);
g_list_store_append (my_g_list_store, "C");
g_list_store_insert (my_g_list_store, "B", 1);
printf("Item : 'C' find in my_g_list_store at position 2 = %d\n",\
g_list_store_find (my_g_list_store, "C", 2));
g_list_store_remove (my_g_list_store, 0);
g_list_store_remove_all (my_g_list_store);
/* create window, etc */
my_window = gtk_window_new ();
gtk_window_set_title (GTK_WINDOW (my_window), "Tree Store");