From 99027fe5f4e632a6e61934d4ea89fb8a647c9d10 Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Fri, 24 May 2024 10:31:29 +0200 Subject: [PATCH] cleaning --- src/ui/events.c | 13 +++++++++++-- src/ui/views.c | 6 +++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/ui/events.c b/src/ui/events.c index 7aa0252..3f84ffa 100644 --- a/src/ui/events.c +++ b/src/ui/events.c @@ -407,10 +407,19 @@ void ui_debug_model_loading (GtkWindow *self, const char *file) * Tree-related signals */ -void on_tree_expander_toggled(GtkExpander *expander, gpointer user_data) +void on_tree_expander_toggled (GtkExpander *expander, gpointer user_data) { // This is a conceptual callback for when an expander is toggled - GtkTreeListRow *row = GTK_TREE_LIST_ROW(user_data); + if (gtk_widget_get_first_child (expander)) + printf("[ui/events.on_tree_expander_toggled()] %s > %s\n",\ + gtk_expander_get_label (expander),\ + gtk_widget_get_name (gtk_expander_get_label (gtk_widget_get_first_child (expander)))); + + GtkTreeListRow *row = GTK_TREE_LIST_ROW (user_data); + + // if (gtk_tree_list_row_is_expandable (row)) return; // TODO + // if (gtk_tree_list_model_get_child_row (row, 0)) return; // TODO + gboolean is_expanded = gtk_tree_list_row_get_expanded(row); gtk_tree_list_row_set_expanded(row, !is_expanded); } diff --git a/src/ui/views.c b/src/ui/views.c index ff5afaf..ea24ab5 100644 --- a/src/ui/views.c +++ b/src/ui/views.c @@ -174,8 +174,12 @@ char* ui_tree_create_model_func (GObject *item, gpointer root) void ui_create_tree (GtkWidget *target_widget) { assert(target_widget); - printf("in src/ui/views.ui_create_tree (GtkWidget *w) : %s > %s > %s > %s\n",\ + printf("[src/ui/views.ui_create_tree (GtkWidget *w)] widgets hiercharchy : %s > %s > %s > %s > %s > %s > %s > %s\n",\ gtk_widget_get_name (GTK_WIDGET (gtk_widget_get_root (target_widget))),\ + gtk_widget_get_name (gtk_widget_get_parent (gtk_widget_get_parent (gtk_widget_get_parent (gtk_widget_get_parent (gtk_widget_get_parent (target_widget)))))),\ + gtk_widget_get_name (gtk_widget_get_parent (gtk_widget_get_parent (gtk_widget_get_parent (gtk_widget_get_parent (target_widget))))),\ + gtk_widget_get_name (gtk_widget_get_parent (gtk_widget_get_parent (gtk_widget_get_parent (target_widget)))),\ + gtk_widget_get_name (gtk_widget_get_parent (gtk_widget_get_parent (target_widget))),\ gtk_widget_get_name (gtk_widget_get_parent (target_widget)),\ gtk_widget_get_name (target_widget),\ gtk_widget_get_name (gtk_widget_get_first_child (target_widget))