Fixed other compilation errors and added a test file. Now to figure out why things are failing at runtime...
This commit is contained in:
parent
c40d950654
commit
8f768d2b91
|
@ -43,11 +43,11 @@ var stall = make(chan struct{})
|
||||||
// TODO
|
// TODO
|
||||||
// - define event
|
// - define event
|
||||||
// - figure out how to return values from event handlers
|
// - figure out how to return values from event handlers
|
||||||
func doevent(e event) {
|
func doevent(e func(Doer)) {
|
||||||
stall <- struct{}{} // enter event handler
|
stall <- struct{}{} // enter event handler
|
||||||
c := make(Doer)
|
c := make(Doer)
|
||||||
go func() {
|
go func() {
|
||||||
e.do(c)
|
e(c)
|
||||||
close(c)
|
close(c)
|
||||||
}()
|
}()
|
||||||
for req := range c {
|
for req := range c {
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
// 8 july 2014
|
||||||
|
|
||||||
|
package ui
|
||||||
|
|
||||||
|
// This file is called zz_test.go to keep it separate from the other files in this package (and because go test won't accept just test.go)
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestPackage(t *testing.T) {
|
||||||
|
go func() {
|
||||||
|
w := GetNewWindow(Do, "Hello", 320, 240)
|
||||||
|
done := make(chan struct{})
|
||||||
|
Wait(Do, w.OnClosing(func(Doer) bool {
|
||||||
|
done <- struct{}{}
|
||||||
|
return true
|
||||||
|
}))
|
||||||
|
Wait(Do, w.Show())
|
||||||
|
<-done
|
||||||
|
}()
|
||||||
|
err := Go()
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue