From a4e9bb8fcc7eca8e6d3f3c8ceb3fcfb23227cc6c Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Wed, 31 Jan 2024 15:06:51 +0100 Subject: [PATCH] =?UTF-8?q?WIP:=20une=20Erreur=20de=20segmentation=20d?= =?UTF-8?q?=C3=A9cidement=20bien=20interessante...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ui/sand_box.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/ui/sand_box.c b/src/ui/sand_box.c index 2be5ad3..5fbec6f 100644 --- a/src/ui/sand_box.c +++ b/src/ui/sand_box.c @@ -40,7 +40,7 @@ void on_activate_window_creation (GtkApplication *app, gpointer data) gtk_window_set_child (GTK_WINDOW (that_window), my_scrolling_thing); gtk_widget_show (that_window); and_now_let_s_climb_that_tree (my_scrolling_thing); - if (data) {g_print (data); g_print (" and is displayed by [sand_box.c / on_activate_window_creation()]\n");} + if (data) {g_print (data); g_print (" and is displayed by : sand_box.c / on_activate_window_creation()\n");} } //------------------------------------------------------------------------------------------------------------------------------------------- @@ -75,14 +75,16 @@ static void on_selection_change (GtkStringList *my_selection_model, guint posit //------------------------------------------------------------------------------------------------------------------------------------------- void on_activating_this_expander (GtkExpander *my_expander, gpointer my_data) { - printf("on_activating exp. > %s\n", gtk_string_object_get_string (GTK_STRING_OBJECT(my_expander)));} + //printf("on_activating exp. > %s\n", gtk_string_object_get_string (GTK_STRING_OBJECT(my_expander))); +} void gtk_expander_set_child (GtkExpander* expander, GtkWidget* child) { - printf("gtk_expander_set_child () %s\n", gtk_string_object_get_string (GTK_STRING_OBJECT(child)));} + //printf("gtk_expander_set_child () %s\n", gtk_string_object_get_string (GTK_STRING_OBJECT(child))); +} GListModel *my_item_create_func (gpointer item, gpointer user_data) { printf("%s ", gtk_string_object_get_string(item)); - gchar *my_child_array[] = {"1", "2", "3", NULL}; + gchar *my_child_array[] = {"10", "2", "3", NULL}; GtkStringList *my_child_string_list = gtk_string_list_new ((const char * const *) my_child_array); if (strcmp(gtk_string_object_get_string(item), "zero")) { @@ -113,7 +115,7 @@ static void and_now_let_s_climb_that_tree (GtkWidget *in_that_box) // https://docs.gtk.org/gtk4/callback.TreeListModelCreateModelFunc.html // https://docs.gtk.org/gtk4/method.TreeListRow.set_expanded.html - GtkTreeListModel *my_tree_list_model = gtk_tree_list_model_new (G_LIST_MODEL (my_string_list), 1, 0, my_item_create_func, NULL, NULL); + GtkTreeListModel *my_tree_list_model = gtk_tree_list_model_new (G_LIST_MODEL (my_string_list), 1, 1, my_item_create_func, NULL, NULL); int rank = 1; printf("in : GListModel *item_create_func (gpointer item,...) (line 80) (item n°%d is %s)\n", rank, gtk_string_list_get_string (my_string_list, rank));