diff options
| author | Pietro Gagliardi <[email protected]> | 2014-02-12 11:29:20 -0500 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-02-12 11:29:20 -0500 |
| commit | ddfb5c760345b03c16c1559bd3e83cbafb8b11c3 (patch) | |
| tree | e182dc1bcdf4f1e2eae7dd333aa27195087f9230 /main.go | |
| parent | 87a99bd675d6bbfedc1e4446c6fd25ee5f55f3a4 (diff) | |
Added buttons.
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -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() } |
