diff options
| author | Pietro Gagliardi <[email protected]> | 2014-06-28 09:37:31 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-06-28 09:37:31 -0400 |
| commit | 3fbf746682de3c68d484eae2343dacb0857da871 (patch) | |
| tree | 262cc4675cb69c7a79da602c71609dfc34cfd5d6 /init.go | |
| parent | 9134189f5216527188441fcc1376568575d78a77 (diff) | |
Added rewrite of most of the dialog system for the new API. The Windows API is, however, getting in the way...
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 + }() } |
