diff options
| author | Pietro Gagliardi <[email protected]> | 2014-02-25 18:40:36 -0500 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-02-25 18:57:19 -0500 |
| commit | c6cafdd402b395edadc6194a77889d84814e5f92 (patch) | |
| tree | 16e3bb4b0889d5e75c3d6470e1e83f40dc718b16 /main_test.go | |
| parent | 7ba3c5ac17d5203038ab33b0b207cef274707dad (diff) | |
Wrote the Grid test and found/fixed one error in Grid's position calculations. (If you compare the previous Windows build with this one, you may not notice a difference; this is because of the default preferred size of Labels being too wide).
Diffstat (limited to 'main_test.go')
| -rw-r--r-- | main_test.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/main_test.go b/main_test.go index 370e102..aad01a2 100644 --- a/main_test.go +++ b/main_test.go @@ -6,6 +6,23 @@ import ( "testing" ) +func gridWindow() (*Window, error) { + w := NewWindow("Grid Test", 400, 400) + b00 := NewButton("0,0") + b01 := NewButton("0,1") + b02 := NewButton("0,2") + l11 := NewListbox(true, "1,1") + b12 := NewButton("1,2") + l20 := NewLabel("2,0") + c21 := NewCheckbox("2,1") + l22 := NewLabel("2,2") + g := NewGrid(3, + b00, b01, b02, + Space(), l11, b12, + l20, c21, l22) + return w, w.Open(g) +} + func TestMain(t *testing.T) { w := NewWindow("Main Window", 320, 240) w.Closing = Event() @@ -50,6 +67,10 @@ func TestMain(t *testing.T) { if err != nil { panic(err) } + gw, err := gridWindow() + if err != nil { + panic(err) + } mainloop: for { @@ -93,5 +114,6 @@ mainloop: pbar.SetProgress(prog) } } + gw.Hide() w.Hide() } |
