UI.Tree

From GiderosMobile
Revision as of 07:21, 17 October 2023 by MoKaLux (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Available since: Gideros 2023.1
Class: UI

Description

Creates a Tree widget.

UI.Tree.new()

Example

local dataMapper=function(item) 
	if type(item)=="string" then 
		return item
	else
		return item.name,item.sub
	end
end
local data = {
	{ name="Root",
		sub={
			"A",
			"B",
			{ name="C",
				sub={
					"1",
					{ name="2",
						sub={"a","b"}
					},
			"3"}},
		"D",
		}
	}
}
local gui = UI.Tree.new()
gui:setDimensions(96, 128)
gui:setColor(0x5c5c5c)
gui:setPosition(50, 50)

gui:setData(data, dataMapper)

local screen=UI.Screen.new()
screen:ui(gui)