From e5b58345d3b42b8d6c22d25eff1b871c668706ac Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Sat, 25 Nov 2023 08:14:39 +0100 Subject: [PATCH] WIP: (micro) cleaning --- include/ui.h | 2 +- src/main.c | 2 +- src/ui/tree.c | 18 +++++++++++------- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/include/ui.h b/include/ui.h index 283da49..31ed441 100644 --- a/include/ui.h +++ b/include/ui.h @@ -126,5 +126,5 @@ void traverse_list_store (GtkListStore *liststore); void onTreeViewRowActivated (GtkTreeView *view, GtkTreePath *path, GtkTreeViewColumn *col, gpointer userdata); -void tree_c_printing_test(void); +void tree_c_test(void); diff --git a/src/main.c b/src/main.c index b5723f7..8e0a417 100644 --- a/src/main.c +++ b/src/main.c @@ -33,7 +33,7 @@ int main(int argc, char **argv) { - tree_c_printing_test(); + tree_c_test(); g_autoptr(GemGraphClientApplication) app = NULL; int res; diff --git a/src/ui/tree.c b/src/ui/tree.c index ed1838e..ac48935 100644 --- a/src/ui/tree.c +++ b/src/ui/tree.c @@ -32,6 +32,8 @@ GtkListStore *list_store; GtkTreeStore *tree_store; GtkTreeIter iter, child; +static void tree_c_printing_test(void); + /*********************************************************** * * * Going through every row in a list store * @@ -91,7 +93,7 @@ onTreeViewRowActivated (GtkTreeView *view, GtkTreePath *path, } void -tree_c_printing_test(void) +tree_c_test(void) { list_store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_UINT); @@ -118,14 +120,16 @@ tree_c_printing_test(void) * right away earlier of course, this is just for demonstration purposes) */ if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(tree_store), &iter)) { - /* Child will point to new row */ - gtk_tree_store_append(tree_store, &child, &iter); - } - else - { - g_error("Oops, we should have a first row in the tree store!\n"); + /* Child will point to new row */ + gtk_tree_store_append(tree_store, &child, &iter); } + else g_error("Oops, we should have a first row in the tree store!\n"); + tree_c_printing_test(); +} + +static void tree_c_printing_test(void) +{ printf("tree_c_printing_test() \ ---------------------------------------------------------\n\n\