From c58171a39ef912e7eddb5d77e09096a5471f41ee Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 20 Aug 2018 10:22:06 -0400 Subject: Moved stddialogs.go back and removed the old TODO-only fontbutton.go. --- stddialogs.go | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 stddialogs.go (limited to 'stddialogs.go') diff --git a/stddialogs.go b/stddialogs.go new file mode 100644 index 0000000..0ff8a01 --- /dev/null +++ b/stddialogs.go @@ -0,0 +1,41 @@ +// 20 december 2015 + +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) +} + +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) +} -- cgit v1.2.3