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 /xmake/core/ui/statusbar.lua | |
| parent | 5924ef4adbe4b084c465bc9604254be60d147074 (diff) | |
fix on event for ui
Diffstat (limited to 'xmake/core/ui/statusbar.lua')
| -rw-r--r-- | xmake/core/ui/statusbar.lua | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/xmake/core/ui/statusbar.lua b/xmake/core/ui/statusbar.lua index 564ac4a15..0c00c730c 100644 --- a/xmake/core/ui/statusbar.lua +++ b/xmake/core/ui/statusbar.lua @@ -28,15 +28,22 @@ $Id: statusbar.lua 18 2007-06-21 20:43:52Z tngd $ --------------------------------------------------------------------------]] -- load modules +local log = require("ui/log") local view = require("ui/view") +local event = require("ui/event") local curses = require("ui/curses") -- define module local statusbar = statusbar or view() -- init statusbar -function statusbar:init(name, bounds) +function statusbar:init(name, bounds, commands) + + -- init view view.init(self, name, bounds) + + -- init info + self:info_set("") end -- exit statusbar @@ -57,11 +64,24 @@ function statusbar:draw() if x < self:width() then c:attr(color):write(string.rep(' ', self:width() - x)) end + + -- draw status info + c:move(1, 0):write(self:info()) +end + +-- on event +function statusbar:event_on(e) + view.event_on(self, e) +end + +-- get status info +function statusbar:info() + return self._INFO end --- do event -function statusbar:do_event(e) - view.do_event(self, e) +-- set status info +function statusbar:info_set(info) + self._INFO = info or "" end -- return module |
