diff options
| author | Pietro Gagliardi <[email protected]> | 2014-06-30 20:55:42 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-06-30 20:55:42 -0400 |
| commit | 46ba0049cb80d8b6973c3146b40ceceaead710ed (patch) | |
| tree | 425bb58415d1d06c15c3b23f592ed686b8c536a2 /dialog_windows.go | |
| parent | 496df12751b029caa7dbbb9480c1a81f242f1c6d (diff) | |
Converted the Windows backend to make uitask a function that runs the func() passed into it, rather than a channel that sends the function to another dispatcher. Windows lets us, since SendMessage() will switch threads if called form another thread. This gets rid of one goroutine and makes things cleaner. Mac OS X has the same optimization avaialble (performSelectorOnMainThread:); GTK+... doesn't seem to...
Diffstat (limited to 'dialog_windows.go')
| -rw-r--r-- | dialog_windows.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/dialog_windows.go b/dialog_windows.go index 655aa8b..910fb88 100644 --- a/dialog_windows.go +++ b/dialog_windows.go @@ -27,10 +27,10 @@ func _msgBox(parent *Window, primarytext string, secondarytext string, uType uin uType |= _MB_TASKMODAL // make modal to every window in the program (they're all windows of the uitask, which is a single thread) } retchan := make(chan int) +_,_,_,_=parenthwnd,ptext,ptitle,fmt.Printf/* TODO go func() { ret := make(chan uiret) defer close(ret) -/* TODO uitask <- &uimsg{ call: _messageBox, p: []uintptr{ @@ -41,13 +41,13 @@ func _msgBox(parent *Window, primarytext string, secondarytext string, uType uin }, ret: ret, } -*/ r := <-ret if r.ret == 0 { // failure panic(fmt.Sprintf("error displaying message box to user: %v\nstyle: 0x%08X\ntitle: %q\ntext:\n%s", r.err, uType, os.Args[0], text)) } retchan <- int(r.ret) }() +*/ return retchan } |
