summaryrefslogtreecommitdiff
path: root/xmake/core/ui/group.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2017-12-14 00:46:35 +0800
committerruki <[email protected]>2017-12-13 22:39:31 +0800
commit42cc615918ee1e4cc3ce435172e9f91dc1df1086 (patch)
tree323c0dbb450f137d1b15eb31a0f279dcd2675309 /xmake/core/ui/group.lua
parent2694f86469cdd776ba2caba9bcd7ec261457aa2c (diff)
fix log and application bug
Diffstat (limited to 'xmake/core/ui/group.lua')
-rw-r--r--xmake/core/ui/group.lua27
1 files changed, 25 insertions, 2 deletions
diff --git a/xmake/core/ui/group.lua b/xmake/core/ui/group.lua
index 064ccfd76..a1f6d3bc7 100644
--- a/xmake/core/ui/group.lua
+++ b/xmake/core/ui/group.lua
@@ -30,20 +30,43 @@ $Id: group.lua 18 2007-06-21 20:43:52Z tngd $
-- load modules
local view = require("ui/view")
local curses = require("ui/curses")
+local dlist = require("base/dlist")
-- define module
local group = group or view()
-- init group
-function group:init(bounds)
- view.init(self, bounds)
+function group:init(name, bounds)
+
+ -- init view
+ view.init(self, name, bounds)
+
+ -- init child views
+ self._VIEWS = dlist()
end
-- exit group
function group:exit()
+
+ -- exit view
view.exit(self)
end
+-- get all child views
+function group:views()
+ return self._VIEWS
+end
+
+-- insert view
+function group:insert(v)
+ self:views():push(v)
+end
+
+-- remove view
+function group:remove(v)
+ self:views():remove(v)
+end
+
-- execute group
function group:execute()
end