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...
This commit is contained in:
parent
63f8033f49
commit
356ed25b52
test
10
test/main.go
10
test/main.go
|
@ -9,6 +9,7 @@ import (
|
||||||
"image/draw"
|
"image/draw"
|
||||||
_ "image/png"
|
_ "image/png"
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"time"
|
||||||
. "github.com/andlabs/ui"
|
. "github.com/andlabs/ui"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -136,7 +137,12 @@ func areaTest() {
|
||||||
draw.Draw(img, img.Rect, ximg, image.ZP, draw.Over)
|
draw.Draw(img, img.Rect, ximg, image.ZP, draw.Over)
|
||||||
w := NewWindow("Area Test", 100, 100)
|
w := NewWindow("Area Test", 100, 100)
|
||||||
a := NewArea()
|
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 {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
@ -144,6 +150,8 @@ func areaTest() {
|
||||||
select {
|
select {
|
||||||
case <-w.Closing:
|
case <-w.Closing:
|
||||||
return
|
return
|
||||||
|
case t := <-timechan:
|
||||||
|
timedisp.SetText(t.String())
|
||||||
case req := <-a.Paint:
|
case req := <-a.Paint:
|
||||||
fmt.Println(req)
|
fmt.Println(req)
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue