From 356ed25b5280c755ccd88d0c931e7c91708379eb Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sun, 16 Mar 2014 11:24:30 -0400 Subject: [PATCH] Added a time display to the Area test for testing deadlocks that will happen when Area becomes more feature-filled... it appears one has now appeared when resizing the window... --- test/main.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/main.go b/test/main.go index 75cba07..d8b69c7 100644 --- a/test/main.go +++ b/test/main.go @@ -9,6 +9,7 @@ import ( "image/draw" _ "image/png" "bytes" + "time" . "github.com/andlabs/ui" ) @@ -136,7 +137,12 @@ func areaTest() { draw.Draw(img, img.Rect, ximg, image.ZP, draw.Over) w := NewWindow("Area Test", 100, 100) a := NewArea() - err = w.Open(a) + timedisp := NewLabel("") + timechan := time.Tick(time.Second) + layout := NewVerticalStack(a, + NewHorizontalStack(timedisp)) + layout.SetStretchy(0) + err = w.Open(layout) if err != nil { panic(err) } @@ -144,6 +150,8 @@ func areaTest() { select { case <-w.Closing: return + case t := <-timechan: + timedisp.SetText(t.String()) case req := <-a.Paint: fmt.Println(req) /*