This commit is contained in:
Jean Sirmai 2024-05-24 10:31:29 +02:00
parent 93eefa54c7
commit 99027fe5f4
Signed by: jean
GPG Key ID: FB3115C340E057E3
2 changed files with 16 additions and 3 deletions

View File

@ -407,10 +407,19 @@ void ui_debug_model_loading (GtkWindow *self, const char *file)
* Tree-related signals * 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 // 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); gboolean is_expanded = gtk_tree_list_row_get_expanded(row);
gtk_tree_list_row_set_expanded(row, !is_expanded); gtk_tree_list_row_set_expanded(row, !is_expanded);
} }

View File

@ -174,8 +174,12 @@ char* ui_tree_create_model_func (GObject *item, gpointer root)
void ui_create_tree (GtkWidget *target_widget) void ui_create_tree (GtkWidget *target_widget)
{ {
assert(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 (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 (gtk_widget_get_parent (target_widget)),\
gtk_widget_get_name (target_widget),\ gtk_widget_get_name (target_widget),\
gtk_widget_get_name (gtk_widget_get_first_child (target_widget)) gtk_widget_get_name (gtk_widget_get_first_child (target_widget))