andlabs-ui/stddialogs.go

42 lines
827 B
Go
Raw Normal View History

// 20 december 2015
2015-12-21 16:14:40 -06:00
package ui
// #include "ui.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)
}
2016-06-09 17:34:16 -05:00
func OpenFile(w *Window) string {
cname := C.uiOpenFile(w.w)
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)
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)
defer freestr(ctitle)
2016-06-09 17:34:16 -05:00
cdescription := C.CString(description)
defer freestr(cdescription)
2016-06-09 17:34:16 -05:00
C.uiMsgBox(w.w, ctitle, cdescription)
}