summaryrefslogtreecommitdiff
path: root/redo/common_unix.go
diff options
context:
space:
mode:
Diffstat (limited to 'redo/common_unix.go')
-rw-r--r--redo/common_unix.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/redo/common_unix.go b/redo/common_unix.go
index e495063..e2d9261 100644
--- a/redo/common_unix.go
+++ b/redo/common_unix.go
@@ -7,6 +7,11 @@ import (
)
// #include "gtk_unix.h"
+// /* because cgo doesn't like g_signal_connect() */
+// void gSignalConnect(gpointer obj, gchar *sig, GCallback callback, gpointer data)
+// {
+// g_signal_connect(obj, sig, callback, data);
+// }
import "C"
func fromgstr(s *C.gchar) string {
@@ -20,3 +25,9 @@ func togstr(s string) *C.gchar {
func freegstr(s *C.gchar) {
C.free(unsafe.Pointer(s))
}
+
+func g_signal_connect(object C.gpointer, name string, to C.GCallback, data C.gpointer) {
+ cname := togstr(name)
+ defer freegstr(cname)
+ C.gSignalConnect(object, cname, to, data)
+}