WIP: simplifications removing the gboolean in struct _TreeItem

This commit is contained in:
Jean Sirmai 2023-12-15 11:02:53 +01:00
parent 8cc77af4f5
commit db3043c274
Signed by: jean
GPG Key ID: FB3115C340E057E3
1 changed files with 9 additions and 17 deletions

View File

@ -42,8 +42,7 @@ typedef struct _TreeItem TreeItem;
struct _TreeItem
{
const char *label;
gboolean AA;
// gboolean CC;
// gboolean AA;
TreeItem *children;
};
@ -52,31 +51,29 @@ enum
{
COLUMN_0,
COLUMN_1,
// VISIBLE_COLUMN,
NUM_COLUMNS
};
/* tree data */
static TreeItem item_name_0[] =
{
{ "A", TRUE, NULL },
{ "B", FALSE, NULL },
{ "A", NULL },
{ "B", NULL },
{ NULL }
};
static TreeItem item_name_1[] =
{
{ "A", FALSE, NULL },
{ "B", TRUE, NULL },
{ "C", FALSE, NULL },
{ "A", NULL },
{ "B", NULL },
{ "C", NULL },
{ NULL }
};
static TreeItem root[] =
{
{ "IT-0", FALSE, item_name_0 },
{ "IT-1", FALSE, item_name_1 },
{ "IT-0", item_name_0 },
{ "IT-1", item_name_1 },
{ NULL }
};
@ -91,9 +88,6 @@ create_model (void)
/* create tree store */
model = gtk_tree_store_new (NUM_COLUMNS,
G_TYPE_STRING,
G_TYPE_BOOLEAN,
G_TYPE_BOOLEAN,
G_TYPE_BOOLEAN,
G_TYPE_BOOLEAN);
/* add data to the tree store */
@ -105,7 +99,6 @@ create_model (void)
gtk_tree_store_set (model, &iter,
COLUMN_0, item_0->label,
COLUMN_1, FALSE,
// VISIBLE_COLUMN, FALSE,
-1);
/* add children */
@ -116,8 +109,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->AA,
// VISIBLE_COLUMN, TRUE,
COLUMN_1, item_1->label, // AA,
-1);
item_1++;