WIP: simplifications removing COLUMN_1

This commit is contained in:
Jean Sirmai 2023-12-15 11:12:24 +01:00
parent db3043c274
commit f6affc1ebf
Signed by: jean
GPG Key ID: FB3115C340E057E3
1 changed files with 13 additions and 14 deletions

View File

@ -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 *