summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorruki <[email protected]>2018-01-17 22:33:14 +0800
committerruki <[email protected]>2018-01-17 09:19:24 +0800
commitd729a22336476e0b8de653d83d0f0bfe7d7b172e (patch)
tree86dca44f59172054b5556989443f688e9c2074d6 /tests
parent4bc80943272b031e41a7047f795d85a04682cbd6 (diff)
fix view:show bug
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/dialog.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/ui/dialog.lua b/tests/ui/dialog.lua
index 6d9c85d0a..af9cd0f61 100644
--- a/tests/ui/dialog.lua
+++ b/tests/ui/dialog.lua
@@ -47,7 +47,7 @@ function demo:init()
-- 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 >", "cm_ok")
+ 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("quit", "< Quit >", "cm_quit")
@@ -57,8 +57,8 @@ function demo:init()
local dialog_hello = textdialog:new("dialog.hello", rect {0, 0, 50, 8}):background_set(dialog_main:frame():background())
dialog_hello:frame():background_set("cyan")
dialog_hello:text():text_set("hello xmake! (http://xmake.io)\nA cross-platform build utility based on Lua"):textattr_set("red")
- dialog_hello:button_add("yes", "< Yes >", function (v, e) self:remove(dialog_hello) end)
- dialog_hello:button_add("no", "< No >", function (v, e) self:remove(dialog_hello) end)
+ dialog_hello:button_add("yes", "< Yes >", function (v, e) dialog_hello:show(false) end)
+ dialog_hello:button_add("no", "< No >", function (v, e) dialog_hello:show(false) end)
self:insert(dialog_hello, {centerx = true, centery = true})
end