summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-03-16 11:24:30 -0400
committerPietro Gagliardi <[email protected]>2014-03-16 11:24:30 -0400
commit356ed25b5280c755ccd88d0c931e7c91708379eb (patch)
treeea287c364540103f0dbf3b3b9dc71d5a1bebd96d
parent63f8033f49532fcbd294a40743348a8009ff81fd (diff)
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...
-rw-r--r--test/main.go10
1 files changed, 9 insertions, 1 deletions
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)
/*