summaryrefslogtreecommitdiff
path: root/redo/dialog_windows.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-08-26 12:52:32 -0400
committerPietro Gagliardi <[email protected]>2014-08-26 12:52:32 -0400
commitadbe5303e7d97e439e1f1f75df23d357b037f702 (patch)
treea9bafa99c1def93cae7afc54c3f2679445b3c0f5 /redo/dialog_windows.go
parente7490ce49b113f4d1877de8f5ee4b40b183fbabf (diff)
Changed the way dialogs work so that they do real modality properly and implemented such on Windows.
Diffstat (limited to 'redo/dialog_windows.go')
-rw-r--r--redo/dialog_windows.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/redo/dialog_windows.go b/redo/dialog_windows.go
index 9ea483c..80f7ac6 100644
--- a/redo/dialog_windows.go
+++ b/redo/dialog_windows.go
@@ -9,11 +9,17 @@ import (
// #include "winapi_windows.h"
import "C"
-func openFile() string {
- name := C.openFile()
+func (w *window) openFile(f func(filename string)) {
+ C.openFile(w.hwnd, unsafe.Pointer(&f))
+}
+
+//export finishOpenFile
+func finishOpenFile(name *C.WCHAR, fp unsafe.Pointer) {
+ f := (*func(string))(fp)
if name == nil {
- return ""
+ (*f)("")
+ return
}
defer C.free(unsafe.Pointer(name))
- return wstrToString(name)
+ (*f)(wstrToString(name))
}