summaryrefslogtreecommitdiff
path: root/dialog.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-03-12 12:14:24 -0400
committerPietro Gagliardi <[email protected]>2014-03-12 12:14:24 -0400
commit2fb7056be4e26a5eecc365cd2608a8e8d552807f (patch)
treef7be4deffa81b6a028796790500e90f66aa2932f /dialog.go
parent6eea59c30a9fb2d87f5806e6ddc12822228ac169 (diff)
Standardized message boxes so they appear similarly on all platforms. This shafts Windows because primary/secondary text message boxes were only added in Windows Vista, but at least MSDN provides discourse.
Diffstat (limited to 'dialog.go')
-rw-r--r--dialog.go15
1 files changed, 9 insertions, 6 deletions
diff --git a/dialog.go b/dialog.go
index 7b4fbeb..f24927b 100644
--- a/dialog.go
+++ b/dialog.go
@@ -2,16 +2,19 @@
package ui
import (
- "fmt"
+ // ...
)
-
// MsgBox displays an informational message box to the user with just an OK button.
-func MsgBox(title string, textfmt string, args ...interface{}) {
- msgBox(title, fmt.Sprintf(textfmt, args...))
+// primaryText should be a short string describing the message, and will be displayed with additional emphasis on platforms that support it.
+// secondaryText can be used to provide more information.
+// On platforms that allow for the message box window to have a title, os.Args[0] is used.
+func MsgBox(primaryText string, secondaryText string) {
+ msgBox(primaryText, secondaryText)
}
// MsgBoxError displays a message box to the user with just an OK button and an icon indicating an error.
-func MsgBoxError(title string, textfmt string, args ...interface{}) {
- msgBoxError(title, fmt.Sprintf(textfmt, args...))
+// Otherwise, it behaves like MsgBox.
+func MsgBoxError(primaryText string, secondaryText string) {
+ msgBoxError(primaryText, secondaryText)
}