Blitz3D+ Command Reference

ModifyTreeViewNode node,text$[,icon]

Parameters

node - tree view node handle

text$ - new node text

icon (optional) - icon index in the tree view's icon strip; -1 for no icon (default)

Description

Changes the text and icon of a tree view node.

Requires Extended language mode.

The node keeps its position, its children and its expanded/selected state - only the label and icon change. In an editor this is how you rename a scene entity in the hierarchy pane after the user types a new name, without tearing the tree down.

Gotcha: the icon parameter always takes effect. Its default is -1 (no icon), so leaving it out strips an icon the node already had - pass the icon index again to keep it. Icons come from the strip attached to the tree view with SetGadgetIconStrip.

The invisible root node returned by TreeViewRoot cannot be relabelled; calling this on it is quietly ignored.

See it working in the world-editor shell sample.

See also: AddTreeViewNode, InsertTreeViewNode, TreeViewNodeText, FreeTreeViewNode, SetGadgetIconStrip.

Index