Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve documentation of stddialogs #297

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions stddialogs.go
Expand Up @@ -5,7 +5,8 @@ package ui
// #include "ui.h"
import "C"

// TODO
// MsgBoxError opens a modal dialog box with graphical error hinting and returns when the
// user acknowledges the message.
func MsgBoxError(w *Window, title string, description string) {
ctitle := C.CString(title)
defer freestr(ctitle)
Expand All @@ -14,6 +15,7 @@ func MsgBoxError(w *Window, title string, description string) {
C.uiMsgBoxError(w.w, ctitle, cdescription)
}

// OpenFile opens a modal allowing the user to select a path to an existing file.
func OpenFile(w *Window) string {
cname := C.uiOpenFile(w.w)
if cname == nil {
Expand All @@ -23,6 +25,8 @@ func OpenFile(w *Window) string {
return C.GoString(cname)
}


// SaveFile opens a modal allowing the user to select a path to a new or existing file.
func SaveFile(w *Window) string {
cname := C.uiSaveFile(w.w)
if cname == nil {
Expand All @@ -31,7 +35,8 @@ func SaveFile(w *Window) string {
defer C.uiFreeText(cname)
return C.GoString(cname)
}

// MsgBox opens a generic modal dialog box and returns when the user acknowledges the
// message.
func MsgBox(w *Window, title string, description string) {
ctitle := C.CString(title)
defer freestr(ctitle)
Expand Down