fix ui elements related things

This commit is contained in:
MihailRis 2026-06-08 22:21:15 +03:00
parent 3429435ff5
commit 84b2aef81f
2 changed files with 15 additions and 9 deletions

View file

@ -77,15 +77,18 @@ function Element.new(docname, name)
end
-- the engine automatically creates an instance for every ui document (layout)
local Document = {}
function Document.new(docname)
return setmetatable({name=docname}, {
__index=function(self, k)
local elem = Element.new(self.name, k)
rawset(self, k, elem)
return elem
local Document = {
__index=function(self, k)
if type(k) ~= "string" then
error("element id is not a string")
end
})
local elem = Element.new(self.name, k)
rawset(self, k, elem)
return elem
end
}
function Document.new(docname)
return setmetatable({name=docname}, Document)
end
local RadioGroup = {}