From 2fb7056be4e26a5eecc365cd2608a8e8d552807f Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Wed, 12 Mar 2014 12:14:24 -0400 Subject: 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. --- test/main.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'test') 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 { -- cgit v1.2.3