TreeViews emit a large number of signals
that you can use to track changes in the view of the model. The signals
generally fall into the following categories:
- expanding and collapsing rows: "row-collapsed",
"row-expanded", "test-collapse-row", "test-expand-row" and
- the cursor: "cursor-changed", "expand-collapse-cursor-row",
"move-cursor", "select-cursor-parent", "select-cursor-row" and
- selection: "select-all", "select-cursor-parent",
"select-cursor-row" and "unselect-all".
- miscellaneous: "columns-changed", "row-activated",
"set-scroll-adjustments" and "start-interactive-search".
The "test-collapse-row" and "test-expand-row" signals are emitted
before a row is collapsed or expanded. The return value from your callback
can cancel or allow the operation - TRUE to allow and
FALSE to cancel.
def callback(treeview, iter, path, user_data)
where iter is a
TreeIter and path is a tree
path pointing at the row and user_data is the data
specified in the connect() method.
The "row-activated" signal is emitted when a double click occurs
on a row or a non-editable row is selected and one of the keys:
Return or Enter is pressed.
The rest of the signals are emitted after the
TreeView has changed. The cursor is the row outlined
by a box. In most cases moving the cursor also moves the selection. The
cursor can be moved independently by Control+Down or
Control+Up and various other key combinations.
See the PyGTK
Reference Manual for more information on the