From 8c3884e619e40ed9d6eba5bb4dc3ade733e758b9 Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Fri, 15 Dec 2023 23:24:39 +0100 Subject: [PATCH] WIP: fonction iterate_node() premier micro-commit --- demos/gtk-demo/tree_store.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/demos/gtk-demo/tree_store.c b/demos/gtk-demo/tree_store.c index fda6319..34e8dee 100644 --- a/demos/gtk-demo/tree_store.c +++ b/demos/gtk-demo/tree_store.c @@ -66,6 +66,13 @@ static TreeItem B[] = {{ "E", E }, { "F", F }, { "G", G }, { NULL }}; static TreeItem A[] = {{ "C", C }, { "D", D }, { NULL }}; static TreeItem R[] = {{ "A", A }, { "B", B }, { NULL }}; +static GtkTreeModel * +iterate_node(GtkTreeStore *model, TreeItem *parent) +{ + printf("parent->label : %s\n", parent->label); + return GTK_TREE_MODEL (model); +} + static GtkTreeModel * create_model (void) { @@ -78,7 +85,6 @@ create_model (void) while (item_0->label) { TreeItem *item_1 = item_0->children; - gtk_tree_store_append (model, &iter, NULL); gtk_tree_store_set (model, &iter, COLUMN_0, item_0->label, -1); @@ -92,6 +98,7 @@ create_model (void) TreeItem *item_2 = item_1->children; while (item_2->label) { GtkTreeIter child_child_iter; + iterate_node(model, item_2); gtk_tree_store_append (model, &child_child_iter, &child_iter); gtk_tree_store_set (model, &child_child_iter, COLUMN_0, item_2->label, -1);