aboutsummaryrefslogtreecommitdiffstats
path: root/core.lua
diff options
context:
space:
mode:
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
--