summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/ui/dialog.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/ui/dialog.lua b/tests/ui/dialog.lua
index af9cd0f61..f662625dc 100644
--- a/tests/ui/dialog.lua
+++ b/tests/ui/dialog.lua
@@ -44,12 +44,17 @@ function demo:init()
-- init background
self:background_set("blue")
+ -- init help dialog
+ local dialog_help = textdialog:new("dialog.help", rect {1, 1, self:width() - 1, self:height() - 1}, "README")
+ dialog_help:text():text_set(io.readfile(path.join(os.scriptdir(), "dialog.lua")))
+ dialog_help:button_add("exit", "< Exit >", function (v, e) self:remove(dialog_help) end)
+
-- init main dialog
local dialog_main = boxdialog:new("dialog.main", rect {1, 1, self:width() - 1, self:height() - 1}, "main dialog")
dialog_main:text():text_set("The project focuses on making development and building easier and provides many features (.e.g package, install, plugin, macro, action, option, task ...), so that any developer can quickly pick it up and enjoy the productivity boost when developing and building project.")
dialog_main:button_add("ok", "< OK >", function (v, e) self:view("dialog.hello"):show(true, {focused = true}) end)
dialog_main:button_add("cancel", "< Cancel >", "cm_cancel")
- dialog_main:button_add("help", "< Help >", "cm_help")
+ dialog_main:button_add("help", "< Help >", function (v, e) self:insert(dialog_help) end)
dialog_main:button_add("quit", "< Quit >", "cm_quit")
self:insert(dialog_main)