2014-08-18 18:01:56 -05:00
|
|
|
// 18 august 2014
|
|
|
|
|
|
|
|
package ui
|
|
|
|
|
|
|
|
import (
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
// #include "winapi_windows.h"
|
|
|
|
import "C"
|
|
|
|
|
2014-08-26 11:52:32 -05:00
|
|
|
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)
|
2014-08-18 18:01:56 -05:00
|
|
|
if name == nil {
|
2014-08-26 11:52:32 -05:00
|
|
|
(*f)("")
|
|
|
|
return
|
2014-08-18 18:01:56 -05:00
|
|
|
}
|
|
|
|
defer C.free(unsafe.Pointer(name))
|
2014-08-26 11:52:32 -05:00
|
|
|
(*f)(wstrToString(name))
|
2014-08-18 18:01:56 -05:00
|
|
|
}
|