TreeView with TreeStore (Python) Marta Maria Casetti mmcasetti@gmail.com 2012 A TreeView displaying a TreeStore (more complex example, with CellRendererToggle) More Complex TreeView with TreeStore

This TreeView displays a TreeStore with two columns, one of which is rendered as a toggle.

Code used to generate this example
Useful methods for a TreeView widget

The TreeView widget is designed around a Model/View/Controller design: the Model stores the data; the View gets change notifications and displays the content of the model; the Controller, finally, changes the state of the model and notifies the view of these changes. For more information and for a list of useful methods for TreeModel see .

In line 48 the "toggled" signal is connected to the callback function on_toggled() using widget.connect(signal, callback function). See for a more detailed explanation.

API References

In this sample we used the following:

GtkTreeView

GtkTreeModel

GtkTreeStore

GtkCellRendererText

GtkCellRendererToggle

GtkTreeViewColumn