Hello, i think the example is wrong too. While trying to understand it (and learn as the same time luaRT, )i rewrote it as :
local ui = require "ui"
local win = ui.Window("Panel.border sample", 320, 200)
local panel = ui.Panel(win,0,0,320,200)
local button = ui.Button(panel, "Shows border")
button:center()
function button:onClick()
panel.border = not panel.border
button.text = panel.border and "Hides border" or "Shows border"
button:center()
end
win:show()
repeat
ui.update()
until not win.visible```