Examples
Some simple example scripts to set the stage.
One-Time script
local exitTool = false
local function close()
lvgl.confirm({title="Exit", message="Really exit?",
confirm=(function() exitTool = true end)
})
end
local function init()
if lvgl == nil then return end
lvgl.clear();
local pg = lvgl.page({title="Test Tool", subtitle="Page 1", back=close})
pg:label({x=70, y=16, color=BLACK, font=DBLSIZE, text="Test Page"})
pg:button({x=200, y=150, text="CLOSE", press=close})
end
local function run(event, touchState)
if lvgl == nil then
lcd.drawText(0, 0, "LVGL support required", COLOR_THEME_WARNING)
end
if (exitTool) then return 2 end
return 0
end
return {init = init, run = run, useLvgl=true}Widget script
Last updated
Was this helpful?

