From bdc8aac4d6407f4e0a2ef7e15bb0c411ca606bb8 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Wed, 30 Jul 2014 22:42:32 -0400 Subject: [PATCH] Added preferred size tests to zz_test.go; these will help for what we're about to do (implement Control.preferredSize() on all other platforms). --- redo/zz_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/redo/zz_test.go b/redo/zz_test.go index b3d44e7..2552642 100644 --- a/redo/zz_test.go +++ b/redo/zz_test.go @@ -28,6 +28,8 @@ var ddata = []dtype{ type testwin struct { t Tab w Window + spw *Stack + sph *Stack s *Stack // TODO make Stack l Label table Table @@ -49,6 +51,22 @@ func (tw *testwin) make(done chan struct{}) { done <- struct{}{} return true }) + tw.spw = NewHorizontalStack( + NewButton("hello"), + NewCheckbox("hello"), + NewTextField(), + NewPasswordField(), + NewTable(reflect.TypeOf(struct{A,B,C int}{})), + NewStandaloneLabel("hello")) + tw.t.Append("Pref Width", tw.spw) + tw.sph = NewVerticalStack( + NewButton("hello"), + NewCheckbox("hello"), + NewTextField(), + NewPasswordField(), + NewTable(reflect.TypeOf(struct{A,B,C int}{})), + NewStandaloneLabel("hello")) + tw.t.Append("Pref Height", tw.sph) stack1 := NewHorizontalStack(NewLabel("Test"), NewTextField()) stack1.SetStretchy(1) stack2 := NewHorizontalStack(NewLabel("Test 2"),