From f6affc1ebf0b5fbdb7801a5e8375588dce77d7d9 Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Fri, 15 Dec 2023 11:12:24 +0100 Subject: [PATCH] WIP: simplifications removing COLUMN_1 --- demos/gtk-demo/tree_store.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/demos/gtk-demo/tree_store.c b/demos/gtk-demo/tree_store.c index 27041ad..4d8759f 100644 --- a/demos/gtk-demo/tree_store.c +++ b/demos/gtk-demo/tree_store.c @@ -42,7 +42,6 @@ typedef struct _TreeItem TreeItem; struct _TreeItem { const char *label; -// gboolean AA; TreeItem *children; }; @@ -50,30 +49,30 @@ struct _TreeItem enum { COLUMN_0, - COLUMN_1, +// COLUMN_1, NUM_COLUMNS }; /* tree data */ static TreeItem item_name_0[] = { - { "A", NULL }, - { "B", NULL }, + { "C", NULL }, + { "D", NULL }, { NULL } }; static TreeItem item_name_1[] = { - { "A", NULL }, - { "B", NULL }, - { "C", NULL }, + { "E", NULL }, + { "F", NULL }, + { "G", NULL }, { NULL } }; static TreeItem root[] = { - { "IT-0", item_name_0 }, - { "IT-1", item_name_1 }, + { "A", item_name_0 }, + { "B", item_name_1 }, { NULL } }; @@ -98,7 +97,7 @@ create_model (void) gtk_tree_store_append (model, &iter, NULL); gtk_tree_store_set (model, &iter, COLUMN_0, item_0->label, - COLUMN_1, FALSE, +// COLUMN_1, FALSE, -1); /* add children */ @@ -109,7 +108,7 @@ create_model (void) gtk_tree_store_append (model, &child_iter, &iter); gtk_tree_store_set (model, &child_iter, COLUMN_0, item_1->label, - COLUMN_1, item_1->label, // AA, +// COLUMN_1, item_1->label, // AA, -1); item_1++; @@ -130,9 +129,9 @@ add_columns (GtkTreeView *treeview) gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (treeview), -1, "Col 0", renderer, "text", COLUMN_0, NULL); - renderer = gtk_cell_renderer_text_new (); g_object_set (renderer, "xalign", 0.0, NULL); - gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (treeview), -1, - "Col 1", renderer, "text", COLUMN_1, NULL); + /* renderer = gtk_cell_renderer_text_new (); g_object_set (renderer, "xalign", 0.0, NULL); */ + /* gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (treeview), -1, */ + /* "Col 1", renderer, "text", COLUMN_1, NULL); */ } GtkWidget *