diff options
author | Kevin <[email protected]> | 2025-01-23 09:34:46 -0300 |
---|---|---|
committer | GitHub <[email protected]> | 2025-01-23 13:34:46 +0100 |
commit | 907230e479ba6c9489463797f81c7348ed754302 (patch) | |
tree | 4f12e013cebcff9097ae6a0e23885f1236b8b3d7 /lang/lua/astal | |
parent | 4d6d85562be7fe25cf659f1f1898244e1bdb44ca (diff) |
add: lua gtk3 examples (#156)
Diffstat (limited to 'lang/lua/astal')
-rw-r--r-- | lang/lua/astal/gtk3/astalify.lua | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/lang/lua/astal/gtk3/astalify.lua b/lang/lua/astal/gtk3/astalify.lua index 5bf3c1d..f1a280b 100644 --- a/lang/lua/astal/gtk3/astalify.lua +++ b/lang/lua/astal/gtk3/astalify.lua @@ -52,15 +52,20 @@ local function includes(tbl, elem) end local function set_children(parent, children) - children = map(flatten(children), function(item) - if Gtk.Widget:is_type_of(item) then - return item - end - return Gtk.Label({ - visible = true, - label = tostring(item), - }) - end) + children = map( + filter(flatten(children), function(item) + return not not item + end), + function(item) + if Gtk.Widget:is_type_of(item) then + return item + end + return Gtk.Label({ + visible = true, + label = tostring(item), + }) + end + ) -- remove if Gtk.Bin:is_type_of(parent) then |