summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-06-12 11:09:56 -0400
committerPietro Gagliardi <[email protected]>2014-06-12 11:09:56 -0400
commit17a6c94e90593fd1aed7f2b693c7ccf947c47a56 (patch)
tree1e08b7fffcaf90c0660f2ffef8734e2168f4c0d1
parentdbf2d8fde7b11864d99811d218ae2b0d7c8157e9 (diff)
Revert all changes to dialog_windows.go because it's interfering with my fixup of sysdata_windows.go.
-rw-r--r--dialog_windows.go21
1 files changed, 12 insertions, 9 deletions
diff --git a/dialog_windows.go b/dialog_windows.go
index 5cc7b33..c6da94b 100644
--- a/dialog_windows.go
+++ b/dialog_windows.go
@@ -28,20 +28,23 @@ func _msgBox(parent *Window, primarytext string, secondarytext string, uType uin
}
retchan := make(chan int)
go func() {
- ret := make(chan int)
+ ret := make(chan uiret)
defer close(ret)
- uitask <- func() {
- r1, _, err := _messageBox.Call(
+ uitask <- &uimsg{
+ call: _messageBox,
+ p: []uintptr{
uintptr(parenthwnd),
utf16ToArg(ptext),
utf16ToArg(ptitle),
- uintptr(uType))
- if r1 == 0 { // failure
- panic(fmt.Sprintf("error displaying message box to user: %v\nstyle: 0x%08X\ntitle: %q\ntext:\n%s", err, uType, os.Args[0], text))
- }
- ret <- int(r1) // so as to not hang up uitask
+ uintptr(uType),
+ },
+ ret: ret,
}
- retchan <- <-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
}