From b8fa3b1704b135eb8674fb82b66ff1053ad1a6b6 Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Wed, 27 Dec 2023 22:38:06 +0100 Subject: [PATCH] WIP: (gtk4-demo:18707): GLib-GIO-CRITICAL **: g_list_store_insert: assertion 'G_IS_LIST_STORE (store)' failed --- demos/gtk-demo/tree_store.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/demos/gtk-demo/tree_store.c b/demos/gtk-demo/tree_store.c index 2a1e65f..2e5baba 100644 --- a/demos/gtk-demo/tree_store.c +++ b/demos/gtk-demo/tree_store.c @@ -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");