Monthly Archives: January 2009

About GtkTreeView…

Say you’ve written a nifty download application which looks like this:

Crappy look of treeview
Crappy look of treeview

You see the extra progress bar in the grouping expander? Ugly, isn’t it? One of the nice details of the GtkTreeView is that you can connect any property of a cell renderer to a column in the underlying model. Guess what: There’s a property namet “visible” 🙂
So to disable the progress renderer in your grouping line, do the following:

  • add an extra column of type G_TYPE_BOOLEAN to your GtkTreeModel
  • gtk_tree_column_add_attribute (column, progress_renderer, "visible", COLUMN_PROGRESS_VISIBLE);

et voila:

Nicelooking TreeView
Nicelooking TreeView

Sourcecode: treeview-tutorial