Skip to content

CreateTreeView

Claude edited this page Oct 27, 2026 · 5 revisions
BlitzPlus

CreateTreeView

CreateTreeView:Int32 x:Int32, y:Int32, width:Int32, height:Int32, group:Int32, style:Int32=0
Parameter Type Default Description
x Int32 required Horizontal position inside the group.
y Int32 required Vertical position inside the group.
width Int32 required Width of the tree.
height Int32 required Height of the tree.
group Int32 required Window, panel, tabber or canvas that holds it.
style 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


Getting started

Language

Tools


Language Features
BlitzBasic
Blitz3D
BlitzPlus
Differences

More

Clone this wiki locally