WIP: une Erreur de segmentation décidement bien interessante...

This commit is contained in:
Jean Sirmai 2024-01-31 15:06:51 +01:00
parent 561adc8b85
commit a4e9bb8fcc
Signed by: jean
GPG Key ID: FB3115C340E057E3
1 changed files with 7 additions and 5 deletions

View File

@ -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_window_set_child (GTK_WINDOW (that_window), my_scrolling_thing);
gtk_widget_show (that_window); gtk_widget_show (that_window);
and_now_let_s_climb_that_tree (my_scrolling_thing); 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) { 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) { 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) GListModel *my_item_create_func (gpointer item, gpointer user_data)
{ {
printf("%s ", gtk_string_object_get_string(item)); 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); GtkStringList *my_child_string_list = gtk_string_list_new ((const char * const *) my_child_array);
if (strcmp(gtk_string_object_get_string(item), "zero")) { 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/callback.TreeListModelCreateModelFunc.html
// https://docs.gtk.org/gtk4/method.TreeListRow.set_expanded.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", 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)); rank, gtk_string_list_get_string (my_string_list, rank));