summaryrefslogtreecommitdiff
path: root/xmake/core/ui/desktop.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2017-12-22 00:51:41 +0800
committerruki <[email protected]>2017-12-21 23:10:09 +0800
commitfe6f634879645e86609dfb014bab5546bfe0e7fc (patch)
tree5c0c436390c8bc7aa3f209558b1f155d3f0a71a8 /xmake/core/ui/desktop.lua
parentbf0ea773b29ca4a85430dcb5ab024ed27a8eeb0c (diff)
rewrite refresh view
Diffstat (limited to 'xmake/core/ui/desktop.lua')
-rw-r--r--xmake/core/ui/desktop.lua18
1 files changed, 18 insertions, 0 deletions
diff --git a/xmake/core/ui/desktop.lua b/xmake/core/ui/desktop.lua
index 899053d48..9bf1e98ea 100644
--- a/xmake/core/ui/desktop.lua
+++ b/xmake/core/ui/desktop.lua
@@ -28,6 +28,7 @@ $Id: desktop.lua 18 2007-06-21 20:43:52Z tngd $
--------------------------------------------------------------------------]]
-- load modules
+local log = require("ui/log")
local group = require("ui/group")
-- define module
@@ -35,7 +36,12 @@ local desktop = desktop or group()
-- init desktop
function desktop:init(name, bounds)
+
+ -- init group
group.init(self, name, bounds)
+
+ -- init color
+ self:attr_set("color", curses.color_pair("white", "blue"))
end
-- exit desktop
@@ -43,5 +49,17 @@ function desktop:exit()
group.exit(self)
end
+-- draw view
+function desktop:draw()
+
+ -- trace
+ log:print("%s: draw ..", self)
+
+ -- draw it
+ local c = self:canvas()
+ c:attr(self:attr("color")):move(0, 0):write(string.rep(' ', self:width() * self:height()))
+end
+
+
-- return module
return desktop