From a7747b95a4fe6d1a76d34e888eef24ad18a27414 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Wed, 11 Jun 2014 10:10:10 -0400 Subject: [PATCH] Added Window.Center() test to the test program. --- test/main.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/main.go b/test/main.go index b39829b..d2c21d1 100644 --- a/test/main.go +++ b/test/main.go @@ -351,11 +351,16 @@ func myMain() { dialog_bMsgBox := NewButton("MsgBox()") dialog_bMsgBoxError := NewButton("MsgBoxError()") + centerButton := NewButton("Center") dialog_win := NewWindow("Dialogs", 200, 200) if *dialogTest { - dialog_win.Open(NewVerticalStack( + s := NewVerticalStack( dialog_bMsgBox, - dialog_bMsgBoxError)) + dialog_bMsgBoxError, + Space(), + centerButton) + s.SetStretchy(2) + dialog_win.Open(s) } var dialog_sret chan struct{} = nil @@ -435,6 +440,8 @@ _=curtime case <-dialog_sret: dialog_sret = nil resetl() + case <-centerButton.Clicked: + dialog_win.Center() } } w.Hide()