summaryrefslogtreecommitdiff
path: root/init.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-04-06 23:33:27 -0400
committerPietro Gagliardi <[email protected]>2014-04-06 23:33:27 -0400
commitf7817f6987f83d84893466ee4f8a99af98ee643f (patch)
treef5562d591887582e1fd720bbf86c2eb83c7fbbaa /init.go
parentaf770340c9d73a60a1484fd3793ab3a2d4e1076b (diff)
Added (untested; VM issues) code to handle Mac OS X Quit Dock menu items and other related stuff that may happen in the future. Will drop the TODO after I can test it.
Diffstat (limited to 'init.go')
-rw-r--r--init.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/init.go b/init.go
index b4214ac..9349713 100644
--- a/init.go
+++ b/init.go
@@ -14,3 +14,14 @@ package ui
func Go(main func()) error {
return ui(main)
}
+
+// AppQuit is pulsed when the user decides to quit the program if their operating system provides a facility for quitting an entire application, rather than merely close all windows (for instance, Mac OS X via the Dock icon).
+// You should assign one of your Windows's Closing to this variable so the user choosing to quit the application is treated the same as closing that window.
+// If you do not respond to this signal, nothing will happen.
+// Do not merely check this channel alone; it is not guaranteed to be pulsed on all systems or in all conditions.
+var AppQuit chan struct{}
+
+func init() {
+ // don't expose this in the documentation
+ AppQuit = newEvent()
+}