Add gui.group{arguments-gui.group.push, func}.
Convenience function that wraps func() in a push/pop pair, i.e. gui.group{grow=grow, spacing=spacing, size=size, pos=pos, function() do_stuff() end} is equivalent to gui.group.push{grow=grow, spacing=spacing, size=size, pos=pos} do_stuff() gui.group.pop()
This commit is contained in:
parent
6f46983115
commit
c1d743ddbd
1 changed files with 11 additions and 3 deletions
12
group.lua
12
group.lua
|
@ -138,6 +138,14 @@ return setmetatable({
|
||||||
beginFrame = beginFrame,
|
beginFrame = beginFrame,
|
||||||
endFrame = endFrame,
|
endFrame = endFrame,
|
||||||
default = default,
|
default = default,
|
||||||
}, {__index = function(_,k)
|
}, {
|
||||||
|
__index = function(_,k)
|
||||||
return ({size = current.size, pos = current.pos})[k]
|
return ({size = current.size, pos = current.pos})[k]
|
||||||
end})
|
end,
|
||||||
|
__call = function(_, info)
|
||||||
|
assert(type(info) == 'table' and type(info[1]) == 'function')
|
||||||
|
push(info)
|
||||||
|
info[1]()
|
||||||
|
pop()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue