Blitz3D+ Command Reference

TreeViewRoot ( treeview )

Parameters

treeview - tree view gadget

Description

Returns the invisible root node of a tree view.

Every tree view owns one root node that is never drawn: the nodes you see at the top level are its children. The root is where building starts - pass it as parent_node to AddTreeViewNode or InsertTreeViewNode to create top-level entries, and to CountTreeViewNodes to count them:

root=TreeViewRoot(tree)
scene=AddTreeViewNode("Scene",root)

Being invisible, the root plays by special rules: it has no text (TreeViewNodeText returns ""), it cannot be selected, expanding or collapsing it does nothing, and FreeTreeViewNode refuses it with a runtime error. To empty the whole tree, free the root's children - or the tree view gadget itself.

The handle stays the same for the life of the tree view, so fetching it once is fine.

See it working in the tree and text area sample and the world editor shell sample.

Requires Extended mode.

See also: CreateTreeView, AddTreeViewNode, InsertTreeViewNode, CountTreeViewNodes, FreeTreeViewNode.

Index