aboutsummaryrefslogtreecommitdiff
path: root/gui/internal/ui/idle.go
diff options
context:
space:
mode:
Diffstat (limited to 'gui/internal/ui/idle.go')
-rw-r--r--gui/internal/ui/idle.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/gui/internal/ui/idle.go b/gui/internal/ui/idle.go
new file mode 100644
index 0000000..cc2a61b
--- /dev/null
+++ b/gui/internal/ui/idle.go
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+package ui
+
+import "github.com/diamondburned/gotk4/pkg/glib/v2"
+
+// idleAdd runs f on the GTK main loop. Every widget touch from a goroutine
+// goes through it.
+func idleAdd(f func()) {
+ glib.IdleAdd(f)
+}