Tree.readonly read/write property


Controls whether the Tree is editable by the user, a true value meaning that the Tree is readonly (the default).

Example

local ui = require "ui" local win = ui.Window("List.border sample", 320, 270) local tree = ui.Tree(win, {"Item1", "Item2", "Item3"}) tree:center() local button = ui.Button(win, "Enable Tree item edition", 80, 10) function update_status() win:status(tree.readonly and "Tree is not editable by user" or "Tree is editable by user") end function button:onClick() tree.readonly = not tree.readonly button.text = tree.readonly and "Enable Tree item edition" or "Disable Tree item edition" update_status() end update_status() ui.run(win):wait()