diff options
Diffstat (limited to 'scripts/gui/hello-world.lua')
| -rw-r--r-- | scripts/gui/hello-world.lua | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/scripts/gui/hello-world.lua b/scripts/gui/hello-world.lua index 80986bbf..c8cd3bd0 100644 --- a/scripts/gui/hello-world.lua +++ b/scripts/gui/hello-world.lua @@ -4,19 +4,21 @@ local gui = require 'gui' local text = 'Woohoo, lua viewscreen :)' -local screen = mkinstance(gui.FramedScreen, { +local screen = gui.FramedScreen{ frame_style = gui.GREY_LINE_FRAME, 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 +} + +function screen:onRenderBody(dc) + dc:seek(3,1):string(text, COLOR_LIGHTGREEN) +end + +function screen:onInput(keys) + if keys.LEAVESCREEN or keys.SELECT then + self:dismiss() end -}):init() +end screen:show() |
