ocarina: Set column visibility through function
I eventually want to be able to choose what columns are shown, so I need them added to the treeview but now shown. Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
parent
a3c8128bbe
commit
bc0be6d831
|
@ -97,9 +97,6 @@ static GtkWidget *setup_window(GtkWidget *treeview)
|
|||
|
||||
static void add_column(GtkCellRenderer *textcell, GtkWidget *treeview, int index)
|
||||
{
|
||||
if (columns[index].visible == false)
|
||||
return;
|
||||
|
||||
GtkTreeViewColumn *column = gtk_tree_view_column_new_with_attributes(
|
||||
columns[index].name, textcell,
|
||||
"text", index, NULL);
|
||||
|
@ -108,6 +105,7 @@ static void add_column(GtkCellRenderer *textcell, GtkWidget *treeview, int index
|
|||
gtk_tree_view_column_set_min_width(column, 2);
|
||||
gtk_tree_view_column_set_max_width(column, 700);
|
||||
gtk_tree_view_column_set_fixed_width(column, columns[index].width);
|
||||
gtk_tree_view_column_set_visible(column, columns[index].visible);
|
||||
gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue