TreeNode Reference Manual

Name

TreeNode - (internal) class to manage the display state of tree nodes in TreeWidgets

Description

TreeNode instances manage the display state of nodes in trees displayed by a TreeWidget. Their use is primarily internal. However, they expose a small set of useful methods to control the display of subtrees.

When a NodeData instance is mapped (i.e. displayed), its _treenode attribute contains a reference to the associated TreeNode instance. This allows e.g. (modifying) NodeData actions to call for an update of its subtree.

Attributes

_parent
a reference to the TreeNode's parent or None, if it is the root.

Methods

expand(expand=1)
expands (unfolds, maps, displays) expand levels in the node's subtree. expand=-1 expands the complete subtree.
collapse()
collapses (folds) the node's subtree: the subtrees rooted at the children are unmapped, only the node itself remains displayed.
update()
update the display of the node's subtree. This may be useful, if an action at the node may have caused a local tree modification.

Dieter Maurer
Last modified: Sun Nov 14 10:30:30 CET 1999