diff options
| author | Pietro Gagliardi <[email protected]> | 2014-07-03 10:02:27 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-07-03 10:02:27 -0400 |
| commit | 9eb9aa82c02a0276df38428895bd840ec8caea02 (patch) | |
| tree | 5621f946a9eac5a7c7ee94f4f3be7990f85beb2d /uitask_darwin.go | |
| parent | 8a81650b3da7ce00725336df9e03b38e935c5a65 (diff) | |
Removed uitask and made the Window creation functions only callable from the main thread. This si the first part in the real major change, which bans all concurrent use of the API and provides a Post() function for communication. I don't like this, but it's the only way. Untested.
Diffstat (limited to 'uitask_darwin.go')
| -rw-r--r-- | uitask_darwin.go | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/uitask_darwin.go b/uitask_darwin.go index 7eecd4f..d4734d5 100644 --- a/uitask_darwin.go +++ b/uitask_darwin.go @@ -13,29 +13,6 @@ import ( // #include "objc_darwin.h" import "C" -// the performSelectorOnMainThread: in our uitask functions is told to wait until the action is done before it returns -// so we're fine keeping this on the Go side since the GC won't collect it from under us -type uitaskParams struct { - window *Window // createWindow - control Control // createWindow - show bool // createWindow -} - -//export uitask_createWindow -func uitask_createWindow(data unsafe.Pointer) { - uc := (*uitaskParams)(data) - uc.window.create(uc.control, uc.show) -} - -func (_uitask) createWindow(w *Window, c Control, s bool) { - uc := &uitaskParams{ - window: w, - control: c, - show: s, - } - C.douitask(appDelegate, C.createWindow, unsafe.Pointer(uc)) -} - func uiinit() error { err := initCocoa() if err != nil { @@ -63,9 +40,3 @@ func initCocoa() (err error) { } return nil } - -//export appDelegate_uitask -func appDelegate_uitask(p unsafe.Pointer) { - f := (*func())(unsafe.Pointer(p)) - (*f)() -} |
