summaryrefslogtreecommitdiff
path: root/tests/ui/hello.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2017-12-27 22:30:21 +0800
committerruki <[email protected]>2017-12-27 09:02:06 +0800
commit5a9bc97b532309a1d13175e5ce4e82a2f430d58e (patch)
treed201b1b561cb7dc70fcbd3eed2029a077ecc2367 /tests/ui/hello.lua
parentc2af438912e29dec6f1e8962633f339a6ab2cab7 (diff)
add two button to hello
Diffstat (limited to 'tests/ui/hello.lua')
-rw-r--r--tests/ui/hello.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/ui/hello.lua b/tests/ui/hello.lua
index 776cee75a..490bf46de 100644
--- a/tests/ui/hello.lua
+++ b/tests/ui/hello.lua
@@ -28,6 +28,7 @@ import("core.ui.rect")
import("core.ui.view")
import("core.ui.label")
import("core.ui.event")
+import("core.ui.button")
import("core.ui.application")
-- the hello application
@@ -44,6 +45,12 @@ function hello:init()
-- add title label
self:desktop():insert(label:new("title", rect {0, 0, 12, 1}, "hello xmake!"), {centerx = true})
+
+ -- add yes button
+ self:desktop():insert(button:new("yes", rect {0, 1, 7, 2}, "< Yes >"), {centerx = true})
+
+ -- add no button
+ self:desktop():insert(button:new("no", rect {0, 2, 6, 3}, "< No >"), {centerx = true})
end
-- on event