diff options
Diffstat (limited to 'init.go')
| -rw-r--r-- | init.go | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -17,13 +17,10 @@ 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; regardless of whether or not you respond to this signal, the application will not quit. -// 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() +// This function is a simple helper functionn that basically pushes the effect of a function call for later. This allows the selected safe Window methods to be safe. +// It's also currently used by the various dialog box functions on Windows to allow them to return instantly, rather than wait for the dialog box to finish (which both GTK+ and Mac OS X let you do). I consider this a race condition bug. TODO (also TODO document the /intended/ behavior) +func touitask(f func()) { + go func() { // to avoid locking uitask itself + uitask <- f + }() } |
