2012-08-21 09:40:37 -06:00
|
|
|
-- Test lua viewscreens.
|
|
|
|
|
|
|
|
local gui = require 'gui'
|
|
|
|
|
|
|
|
local text = 'Woohoo, lua viewscreen :)'
|
|
|
|
|
2012-09-18 10:30:25 -06:00
|
|
|
local screen = gui.FramedScreen{
|
2012-08-22 03:06:06 -06:00
|
|
|
frame_style = gui.GREY_LINE_FRAME,
|
2012-08-21 09:40:37 -06:00
|
|
|
frame_title = 'Hello World',
|
2012-10-15 05:30:00 -06:00
|
|
|
frame_width = #text,
|
|
|
|
frame_height = 1,
|
|
|
|
frame_inset = 1,
|
2012-09-18 10:30:25 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
function screen:onRenderBody(dc)
|
2012-10-15 05:30:00 -06:00
|
|
|
dc:string(text, COLOR_LIGHTGREEN)
|
2012-09-18 10:30:25 -06:00
|
|
|
end
|
|
|
|
|
|
|
|
function screen:onInput(keys)
|
|
|
|
if keys.LEAVESCREEN or keys.SELECT then
|
|
|
|
self:dismiss()
|
2012-08-21 09:40:37 -06:00
|
|
|
end
|
2012-09-18 10:30:25 -06:00
|
|
|
end
|
2012-08-21 09:40:37 -06:00
|
|
|
|
|
|
|
screen:show()
|