class Iup::Tree

A tree displays a hierarchy of branch and leaf nodes. Each node may display some text and an optional image.

Example

tree = Iup::Tree.new

dlg = Iup::Dialog.new(tree) do |d|
  d.title = 'Tree Example'
end.map

tree.size = '80x80'
tree.font = 'Courier, Normal 10'
tree.addbranch(0, '3D')
tree.addbranch(0, '2D')
tree.addleaf(1, 'trapeze')
tree.addbranch(1, 'parallelogram')
tree.addleaf(2, 'diamond')
tree.addleaf(2, 'square')
tree.addbranch(4, 'triangle')
tree.addleaf(5, 'scalenus')
tree.addleaf(5, 'isoceles')
tree.addleaf(5, 'equilateral')
tree.value = 6
tree.addexpanded = 'no'

dlg.show

Note: the contents of the tree can only be created after its containing dialog has been mapped.