diff options
| author | ruki <[email protected]> | 2017-12-20 23:20:43 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-12-20 14:04:19 +0800 |
| commit | bf0ea773b29ca4a85430dcb5ab024ed27a8eeb0c (patch) | |
| tree | f21820ed08d80213c1049b50e1b99b07bc19f627 /tests/ui/hello.lua | |
| parent | 5924ef4adbe4b084c465bc9604254be60d147074 (diff) | |
fix on event for ui
Diffstat (limited to 'tests/ui/hello.lua')
| -rw-r--r-- | tests/ui/hello.lua | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/ui/hello.lua b/tests/ui/hello.lua index 21bcd1b96..a069d015c 100644 --- a/tests/ui/hello.lua +++ b/tests/ui/hello.lua @@ -23,6 +23,9 @@ -- -- imports +import("core.ui.log") +import("core.ui.view") +import("core.ui.event") import("core.ui.application") -- the hello application @@ -35,7 +38,15 @@ function hello:init() application.init(self, "hello") -- init title - self:menubar():title_set("xmake") + self:menubar():title_set("Menu Bar (Hello)") +end + +-- on event +function hello:event_on(e) + view.event_on(self, e) + if e.type == event.ev_keyboard then + self:statusbar():info_set(e.key_name) + end end -- main entry |
