summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-03-05 13:25:19 -0500
committerPietro Gagliardi <[email protected]>2014-03-05 13:25:19 -0500
commit011836e94de2b1ba2c9fc729649db63f715997f9 (patch)
treecc02f93769aa0e62f8d778dc7ee0f1904f403314
parentc0c1e091865029aa1006602d2b195b5c6c4c8dae (diff)
Have ui.Go() return on main() return on Unix.
-rw-r--r--gtkcalls_unix.go4
-rw-r--r--uitask_unix.go5
2 files changed, 8 insertions, 1 deletions
diff --git a/gtkcalls_unix.go b/gtkcalls_unix.go
index 989c80d..5dd6f25 100644
--- a/gtkcalls_unix.go
+++ b/gtkcalls_unix.go
@@ -32,6 +32,10 @@ func gtk_main() {
C.gtk_main()
}
+func gtk_main_quit() {
+ C.gtk_main_quit()
+}
+
func gtk_window_new() *gtkWidget {
// 0 == GTK_WINDOW_TOPLEVEL (the only other type, _POPUP, should not be used)
return fromgtkwidget(C.gtk_window_new(0))
diff --git a/uitask_unix.go b/uitask_unix.go
index 759ac1d..9b22635 100644
--- a/uitask_unix.go
+++ b/uitask_unix.go
@@ -28,7 +28,10 @@ func ui(main func()) error {
return true // don't destroy the callback
})
- go main()
+ go func() {
+ main()
+ uitask <- gtk_main_quit
+ }()
gtk_main()
return nil