4.2. Tree View Look and Feel

There are a couple of ways to influence the look and feel of the tree view. You can hide or show column headers with gtk_tree_view_set_headers_visible, and set them clickable or not with gtk_tree_view_set_headers_clickable (which will be done automatically for you if you enable sorting).

gtk_tree_view_set_rules_hint will enable or disable rules in the tree view. [1] As the function name implies, this setting is only a hint; in the end it depends on the active Gtk+ theme engine if the tree view shows ruled lines or not. Users seem to have strong feelings about rules in tree views, so it is probably a good idea to provide an option somewhere to disable rule hinting if you set it on tree views (but then, people also seem to have strong feelings about options abundance and 'sensible' default options, so whatever you do will probably upset someone at some point).

The expander column can be set with gtk_tree_view_set_expander_column. This is the column where child elements are indented with respect to their parents, and where rows with children have an 'expander' arrow with which a node's children can be collapsed (hidden) or expanded (shown). By default, this is the first column.



'Rules' means that every second line of the tree view has a shaded background, which makes it easier to see which cell belongs to which row in tree views that have a lot of columns.