diff options
| author | Pietro Gagliardi <[email protected]> | 2016-06-19 15:09:41 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2016-06-19 15:09:41 -0400 |
| commit | 28012570b0b91f3a4bf64324f5ff90028b36508b (patch) | |
| tree | ad558e299d5ecf7487c1f7f8755ccc3ece6f5ec8 | |
| parent | 793598c2faba3403bbbd0867e061adf212c0073e (diff) | |
| parent | 2dde2a79e7020f065d94d9bc17e0191bf18a5bff (diff) | |
Merge branch 'master' of github.com:andlabs/ui
| -rw-r--r-- | link_windows_386.go | 2 | ||||
| -rw-r--r-- | link_windows_amd64.go | 2 | ||||
| -rw-r--r-- | static_windows_386.syso (renamed from static_windows_386.o) | bin | 1308 -> 1308 bytes | |||
| -rw-r--r-- | static_windows_amd64.syso (renamed from static_windows_amd64.o) | bin | 1308 -> 1308 bytes | |||
| -rw-r--r-- | stddialogs.go | 24 |
5 files changed, 16 insertions, 12 deletions
diff --git a/link_windows_386.go b/link_windows_386.go index 3ea6183..f223ae1 100644 --- a/link_windows_386.go +++ b/link_windows_386.go @@ -2,7 +2,7 @@ package ui -// #cgo LDFLAGS: ${SRCDIR}/static_windows_386.o ${SRCDIR}/libui_windows_386.a ${SRCDIR}/libui_windows_386.res.o +// #cgo LDFLAGS: ${SRCDIR}/libui_windows_386.a ${SRCDIR}/libui_windows_386.res.o // /* note the order; also note the lack of uuid */ // #cgo LDFLAGS: -luser32 -lkernel32 -lusp10 -lgdi32 -lcomctl32 -luxtheme -lmsimg32 -lcomdlg32 -ld2d1 -ldwrite -lole32 -loleaut32 -loleacc -static -static-libgcc -static-libstdc++ import "C" diff --git a/link_windows_amd64.go b/link_windows_amd64.go index 1992ae7..515bbd1 100644 --- a/link_windows_amd64.go +++ b/link_windows_amd64.go @@ -2,7 +2,7 @@ package ui -// #cgo LDFLAGS: ${SRCDIR}/static_windows_amd64.o ${SRCDIR}/libui_windows_amd64.a ${SRCDIR}/libui_windows_amd64.res.o +// #cgo LDFLAGS: ${SRCDIR}/libui_windows_amd64.a ${SRCDIR}/libui_windows_amd64.res.o // /* note the order; also note the lack of uuid */ // #cgo LDFLAGS: -luser32 -lkernel32 -lusp10 -lgdi32 -lcomctl32 -luxtheme -lmsimg32 -lcomdlg32 -ld2d1 -ldwrite -lole32 -loleaut32 -loleacc -static -static-libgcc -static-libstdc++ import "C" diff --git a/static_windows_386.o b/static_windows_386.syso Binary files differindex 46c6ccc..46c6ccc 100644 --- a/static_windows_386.o +++ b/static_windows_386.syso diff --git a/static_windows_amd64.o b/static_windows_amd64.syso Binary files differindex eb56b3b..eb56b3b 100644 --- a/static_windows_amd64.o +++ b/static_windows_amd64.syso diff --git a/stddialogs.go b/stddialogs.go index 7954512..0ff8a01 100644 --- a/stddialogs.go +++ b/stddialogs.go @@ -8,30 +8,34 @@ import "C" // TODO func MsgBoxError(w *Window, title string, description string) { ctitle := C.CString(title) + defer freestr(ctitle) cdescription := C.CString(description) + defer freestr(cdescription) C.uiMsgBoxError(w.w, ctitle, cdescription) - freestr(ctitle) - freestr(cdescription) } func OpenFile(w *Window) string { cname := C.uiOpenFile(w.w) - name := C.GoString(cname) - C.uiFreeText(cname) - return name + if cname == nil { + return "" + } + defer C.uiFreeText(cname) + return C.GoString(cname) } func SaveFile(w *Window) string { cname := C.uiSaveFile(w.w) - name := C.GoString(cname) - C.uiFreeText(cname) - return name + if cname == nil { + return "" + } + defer C.uiFreeText(cname) + return C.GoString(cname) } func MsgBox(w *Window, title string, description string) { ctitle := C.CString(title) + defer freestr(ctitle) cdescription := C.CString(description) + defer freestr(cdescription) C.uiMsgBox(w.w, ctitle, cdescription) - freestr(ctitle) - freestr(cdescription) } |
