From ca74fb7ad016f9ceee3756a973baa2d87a8aa1d6 Mon Sep 17 00:00:00 2001 From: Aylur Date: Tue, 4 Jun 2024 23:05:41 +0200 Subject: small fixes * export Gdk * flatten jsx children --- lua/astal/widget.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lua/astal/widget.lua') 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 -- cgit v1.2.3