summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/main.go b/main.go
index 70caf80..09fae17 100644
--- a/main.go
+++ b/main.go
@@ -4,11 +4,21 @@ package main
func main() {
w := NewWindow("Main Window", 320, 240)
w.Closing = make(chan struct{})
+ b := NewButton("Click Me")
+ w.SetControl(b)
err := w.Open()
if err != nil {
panic(err)
}
- <-w.Closing
+mainloop:
+ for {
+ select {
+ case <-w.Closing:
+ break mainloop
+ case <-b.Clicked:
+ println("clicked")
+ }
+ }
w.Close()
}