summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2018-03-27 20:19:27 -0400
committerPietro Gagliardi <[email protected]>2018-03-27 20:19:27 -0400
commit6c3bda44d3039e3721c06516be3ab9ce9cbd48cc (patch)
tree362b038562995b749137c473831342c83e854f19
parent8716bfd161e0bc2b897d151e3585b231abec848e (diff)
Added some extra documentation to QueueMain. Fixes #164.
-rw-r--r--main.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/main.go b/main.go
index f6109f3..ddfefe1 100644
--- a/main.go
+++ b/main.go
@@ -79,6 +79,14 @@ var (
// primary purpose is to allow communication between other
// goroutines and the GUI thread. Calling QueueMain after Quit
// has been called results in undefined behavior.
+//
+// If you start a goroutine in f, it also cannot call package ui
+// functions. So for instance, the following will result in
+// undefined behavior:
+//
+// ui.QueueMain(func() {
+// go ui.MsgBox(...)
+// })
func QueueMain(f func()) {
qmlock.Lock()
defer qmlock.Unlock()