A TreeViewColumn can be packed into a TreeView. It can display a header to describe the content of the column, from which items can be placed within to display the content.


The TreeViewColumn can be constructed using the following:

treeviewcolumn = Gtk.TreeViewColumn(title)

The title property is a textual string which is attached to the top of the TreeView and describes the content.


The column title can also be specified after construction by:


Setting the title argument is always useful, however the text will only be displayed in the TreeView permits it.

Items can be packed into the column via two methods:

treeviewcolumn.pack_start(cellrenderer, expand)
treeviewcolumn.pack_end(cellrenderer, expand)

The cellrenderer property should be the name of the CellRenderer which is to be added to the column. The expand property can be set to True which expands the column to fill all available space, or False which shrinks it to fit the content only.

All the items from a column can be removed using:


When multiple CellRenderer widgets are packed into a column, they have no spacing between. This can be modified with:


Configuring whether a column is visible can be set with:


When visible is False, the column is removed from view however still retains any settings specified.

By default, columns can not be resized. Changing this allows the user to set a custom width:


The sizing of the column can also be customised in a number of ways depending on the change in the content by using the method:


The sizing argument can be set to Gtk.TreeViewColumnSizing.GROW_ONLY sets the column to never shrink regardless of the content, Gtk.TreeViewColumnSizing.AUTOSIZE adjusts the column to be an optimal size and is updated everytime the model changes, and Gtk.TreeViewColumnSizing.FIXED which sets columns to be a fixed pixel width.

Minimum and maximum column widths can be specified by calling:


Columns within the TreeView can be moved by specifying on each: