diff options
| author | Pietro Gagliardi <[email protected]> | 2014-07-03 11:04:07 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-07-03 11:04:07 -0400 |
| commit | 1238936a16170757104879d9593ba9440c70e8cd (patch) | |
| tree | eade2af3e7602a986dd7144032c72a18f59c9825 /uitask.go | |
| parent | f7dedc8cb05960134234f242042a4f00d88aaf9e (diff) | |
Added Post() and implemented it on Windows.
Diffstat (limited to 'uitask.go')
| -rw-r--r-- | uitask.go | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -26,6 +26,14 @@ func Go(start func()) error { return nil } +// Post issues a request to the given Window to do something on the main thread. +// Note the name of the function: there is no guarantee that the request will be handled immediately. +// Because this can be safely called from any goroutine, it is a package-level function, and not a method on Window. +// TODO garbage collection +func Post(w *Window, data interface{}) { + uipost(w, data) +} + // TODO this needs to be replaced with a function // Stop should be pulsed when you are ready for Go() to return. // Pulsing Stop will cause Go() to return immediately; the programmer is responsible for cleaning up (for instance, hiding open Windows) beforehand. |
