Skip to content

CreateTreeView

Narta Xaymar Dirks edited this page Oct 28, 2026 · 5 revisions
BlitzPlus

CreateTreeView

CreateTreeView:Int32 x:Int32, y:Int32, width:Int32, height:Int32, group:Int32, style:Int32=0
Parameter Mode Type Default Description
x In Int32 required Horizontal position inside the group.
y In Int32 required Vertical position inside the group.
width In Int32 required Width of the tree.
height In Int32 required Height of the tree.
group In Int32 required Window, panel, tabber or canvas that holds it.
style In Int32 0 0, or 65536 to not follow the group when it is resized. Defaults to 0.

Returns: A handle for the tree view.

Description

Makes a list of nodes that can be opened and closed, like a folder view. Clicking a node sends $401 with the tree as the source, and SelectedTreeViewNode tells which. The tree starts out empty: add nodes below the node that TreeViewRoot gives.

Examples

Graphics 320, 240, 32, 2
win  = CreateWindow("Tree", 10, 10, 300, 200, Desktop(), 3)
tree = CreateTreeView(10, 10, 270, 140, win)
fruit = AddTreeViewNode("Fruit", TreeViewRoot(tree))
AddTreeViewNode "Apple", fruit
AddTreeViewNode "Pear", fruit
Repeat
	e = WaitEvent()
	If e = $401 Then SetGadgetText win, "Node " + TreeViewNodeText(SelectedTreeViewNode(tree))
Until e = $803

Media

CreateTreeView

Related Commands

AddTreeViewNode, CollapseTreeViewNode, CountTreeViewNodes, ExpandTreeViewNode, FreeTreeViewNode, InsertTreeViewNode, ModifyTreeViewNode, SelectedTreeViewNode

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally