2012-08-21 09:40:37 -06:00
|
|
|
-- Test lua viewscreens.
|
|
|
|
|
|
|
|
local gui = require 'gui'
|
|
|
|
|
|
|
|
local text = 'Woohoo, lua viewscreen :)'
|
|
|
|
|
|
|
|
local screen = mkinstance(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',
|
|
|
|
frame_width = #text+6,
|
|
|
|
frame_height = 3,
|
|
|
|
onRenderBody = function(self, dc)
|
|
|
|
dc:seek(3,1):string(text, COLOR_LIGHTGREEN)
|
|
|
|
end,
|
|
|
|
onInput = function(self,keys)
|
|
|
|
if keys.LEAVESCREEN or keys.SELECT then
|
|
|
|
self:dismiss()
|
|
|
|
end
|
|
|
|
end
|
2012-08-24 03:28:34 -06:00
|
|
|
}):init()
|
2012-08-21 09:40:37 -06:00
|
|
|
|
|
|
|
screen:show()
|