forked from andlabs/ui
-
Notifications
You must be signed in to change notification settings - Fork 2
/
stddialogs.go
41 lines (35 loc) · 830 Bytes
/
stddialogs.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// 20 december 2015
package ui
// #include "pkgui.h"
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)
}
func OpenFile(w *Window) string {
cname := C.uiOpenFile(w.w)
if cname == nil {
return ""
}
defer C.uiFreeText(cname)
return C.GoString(cname)
}
func SaveFile(w *Window) string {
cname := C.uiSaveFile(w.w)
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)
}