aboutsummaryrefslogtreecommitdiffstats
path: root/core.lua
diff options
context:
space:
mode:
authorMatthias Richter <vrld@vrld.org>2013-01-23 13:18:58 +0100
committerMatthias Richter <vrld@vrld.org>2013-01-23 13:18:58 +0100
commite5c9e7e29fd34271522a4ed7dfc6b8b8ee6670cd (patch)
treed508a22e72112d6563a25689f15df1b42da3fae7 /core.lua
parentf799f48164775ce79a09fc5edf2f22e4b324c57c (diff)
downloadQuickie-e5c9e7e29fd34271522a4ed7dfc6b8b8ee6670cd.tar.gz
Quickie-e5c9e7e29fd34271522a4ed7dfc6b8b8ee6670cd.tar.bz2
Quickie-e5c9e7e29fd34271522a4ed7dfc6b8b8ee6670cd.tar.xz
Quickie-e5c9e7e29fd34271522a4ed7dfc6b8b8ee6670cd.zip
Allow setting custom widget ids
Diffstat (limited to 'core.lua')
-rw-r--r--core.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/core.lua b/core.lua
index 67602ac..533ab96 100644
--- a/core.lua
+++ b/core.lua
@@ -65,10 +65,15 @@ end
--
-- Widget ID
--
-local maxid = 0
+local maxid, uids = 0, {}
+setmetatable(uids, {__index = function(t, i)
+ t[i] = {}
+ return t[i]
+end})
+
local function generateID()
maxid = maxid + 1
- return maxid
+ return uids[maxid]
end
--