This TreeView displays a simple ListStore with the selection "changed" signal connected.
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 44 the "changed"
signal is connected to the callback function on_changed()
using widget.connect(signal, callback function)
. See for a more detailed explanation.
In this sample we used the following:
GtkTreeView
GtkTreeModel
GtkListStore
GtkCellRendererText
GtkTreeViewColumn
pygobject - Python bindings for GObject Introspection
Fonts