summaryrefslogtreecommitdiff
path: root/test
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 /test
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 'test')
-rw-r--r--test/main.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/main.go b/test/main.go
index 3dbae24..77adfae 100644
--- a/test/main.go
+++ b/test/main.go
@@ -40,7 +40,7 @@ var macCrashTest = flag.Bool("maccrash", false, "attempt crash on Mac OS X on de
func invalidTest(c *Combobox, l *Listbox, s *Stack, g *Grid) {
x := func(what string ) {
if j := recover(); j == nil {
- MsgBoxError("test", "%s: no panic", what)
+ MsgBoxError("test", fmt.Sprintf("%s: no panic", what))
panic("invalid test fail")
} else {
println("got", j.(error).Error())
@@ -200,12 +200,16 @@ mainloop:
lb2.Delete(4)
}
case <-b3.Clicked:
- MsgBox("List Info",
- "cb1: %d %q (len %d)\ncb2: %d %q (len %d)\nlb1: %d %q (len %d)\nlb2: %d %q (len %d)",
+ f := MsgBox
+ if c.Checked() {
+ f = MsgBoxError
+ }
+ f("List Info",
+ fmt.Sprintf("cb1: %d %q (len %d)\ncb2: %d %q (len %d)\nlb1: %d %q (len %d)\nlb2: %d %q (len %d)",
cb1.SelectedIndex(), cb1.Selection(), cb1.Len(),
cb2.SelectedIndex(), cb2.Selection(), cb2.Len(),
lb1.SelectedIndices(), lb1.Selection(), lb1.Len(),
- lb2.SelectedIndices(), lb2.Selection(), lb2.Len())
+ lb2.SelectedIndices(), lb2.Selection(), lb2.Len()))
case <-incButton.Clicked:
prog++
if prog > 100 {