2015-12-20 17:35:01 -06:00
|
|
|
// 20 december 2015
|
2015-12-21 16:14:40 -06:00
|
|
|
|
2015-12-20 17:35:01 -06:00
|
|
|
package ui
|
|
|
|
|
2018-08-26 12:48:13 -05:00
|
|
|
// #include "pkgui.h"
|
2015-12-20 17:35:01 -06:00
|
|
|
import "C"
|
|
|
|
|
|
|
|
// TODO
|
|
|
|
func MsgBoxError(w *Window, title string, description string) {
|
|
|
|
ctitle := C.CString(title)
|
2016-06-10 09:03:53 -05:00
|
|
|
defer freestr(ctitle)
|
2015-12-20 17:35:01 -06:00
|
|
|
cdescription := C.CString(description)
|
2016-06-10 09:03:53 -05:00
|
|
|
defer freestr(cdescription)
|
2015-12-20 17:35:01 -06:00
|
|
|
C.uiMsgBoxError(w.w, ctitle, cdescription)
|
|
|
|
}
|
2016-06-09 17:34:16 -05:00
|
|
|
|
|
|
|
func OpenFile(w *Window) string {
|
|
|
|
cname := C.uiOpenFile(w.w)
|
2016-06-10 09:03:53 -05:00
|
|
|
if cname == nil {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
defer C.uiFreeText(cname)
|
|
|
|
return C.GoString(cname)
|
2016-06-09 17:34:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
func SaveFile(w *Window) string {
|
|
|
|
cname := C.uiSaveFile(w.w)
|
2016-06-10 09:03:53 -05:00
|
|
|
if cname == nil {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
defer C.uiFreeText(cname)
|
|
|
|
return C.GoString(cname)
|
2016-06-09 17:34:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
func MsgBox(w *Window, title string, description string) {
|
|
|
|
ctitle := C.CString(title)
|
2016-06-10 09:03:53 -05:00
|
|
|
defer freestr(ctitle)
|
2016-06-09 17:34:16 -05:00
|
|
|
cdescription := C.CString(description)
|
2016-06-10 09:03:53 -05:00
|
|
|
defer freestr(cdescription)
|
2016-06-09 17:34:16 -05:00
|
|
|
C.uiMsgBox(w.w, ctitle, cdescription)
|
|
|
|
}
|