summaryrefslogtreecommitdiff
path: root/redo/zz_test.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-07-19 10:16:00 -0400
committerPietro Gagliardi <[email protected]>2014-07-19 10:16:00 -0400
commit214dc6cd5c810e35b45d035d214e18491e0a80c9 (patch)
tree69a665425f04e7b108746b3490afff05000c8e2f /redo/zz_test.go
parent627abfd5939f57877179d6676e1ec66ea73a0717 (diff)
Ah, fixed the stalling: logic error in the test program itself.
Diffstat (limited to 'redo/zz_test.go')
-rw-r--r--redo/zz_test.go45
1 files changed, 24 insertions, 21 deletions
diff --git a/redo/zz_test.go b/redo/zz_test.go
index a0751dc..1ea1276 100644
--- a/redo/zz_test.go
+++ b/redo/zz_test.go
@@ -14,34 +14,37 @@ var closeOnClick = flag.Bool("close", false, "close on click")
// because Cocoa hates being run off the main thread, even if it's run exclusively off the main thread
func init() {
flag.Parse()
- go Do(func() {
- w := NewWindow("Hello", 320, 240)
- b := NewButton("There")
- w.SetControl(b)
- if *closeOnClick {
- b.SetText("Click to Close")
- }
+ go func() {
done := make(chan struct{})
- w.OnClosing(func() bool {
+ Do(func() {
+ w := NewWindow("Hello", 320, 240)
+ b := NewButton("There")
+ w.SetControl(b)
if *closeOnClick {
- panic("window closed normally in close on click mode (should not happen)")
+ b.SetText("Click to Close")
}
- println("window close event received")
- Stop()
- done <- struct{}{}
- return true
- })
- b.OnClicked(func() {
- println("in OnClicked()")
- if *closeOnClick {
- w.Close()
+ w.OnClosing(func() bool {
+ if *closeOnClick {
+ panic("window closed normally in close on click mode (should not happen)")
+ }
+ println("window close event received")
Stop()
done <- struct{}{}
- }
+ return true
+ })
+ // GTK+ TODO: this is causing a resize event to happen afterward?!
+ b.OnClicked(func() {
+ println("in OnClicked()")
+ if *closeOnClick {
+ w.Close()
+ Stop()
+ done <- struct{}{}
+ }
+ })
+ w.Show()
})
- w.Show()
<-done
- })
+ }()
err := Go()
if err != nil {
panic(err)