diff options
author | Aylur <[email protected]> | 2024-06-04 23:05:41 +0200 |
---|---|---|
committer | Aylur <[email protected]> | 2024-06-04 23:05:41 +0200 |
commit | ca74fb7ad016f9ceee3756a973baa2d87a8aa1d6 (patch) | |
tree | d935caa5959c1344ce9e99ae3ca9be699426ad2a /lua/astal/widget.lua | |
parent | cfe3244e61207d4d761f2522546cb2bfb1c539f3 (diff) |
small fixes
* export Gdk
* flatten jsx children
Diffstat (limited to 'lua/astal/widget.lua')
-rw-r--r-- | lua/astal/widget.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lua/astal/widget.lua b/lua/astal/widget.lua index 2f58b7a..7be240f 100644 --- a/lua/astal/widget.lua +++ b/lua/astal/widget.lua @@ -3,6 +3,7 @@ local Astal = lgi.require("Astal", "0.1") local Gtk = lgi.require("Gtk", "3.0") local GObject = lgi.require("GObject", "2.0") local Binding = require("astal.binding") +local exec_async = require("astal.process").exec_async local function filter(tbl, fn) local copy = {} @@ -101,6 +102,14 @@ local function astalify(ctor) end end + for prop, value in pairs(props) do + if string.sub(prop, 0, 2) == "on" and type(value) ~= "function" then + props[prop] = function() + exec_async(value, print, print) + end + end + end + local widget = ctor(props) for prop, binding in pairs(bindings) do |