andlabs-ui/main.go

27 lines
385 B
Go
Raw Normal View History

// 11 february 2014
package main
func main() {
w := NewWindow("Main Window", 320, 240)
w.Closing = make(chan struct{})
2014-02-12 10:29:20 -06:00
b := NewButton("Click Me")
err := w.Open(b)
if err != nil {
panic(err)
}
2014-02-12 10:29:20 -06:00
mainloop:
for {
select {
case <-w.Closing:
break mainloop
case <-b.Clicked:
err := w.SetTitle("Button Clicked")
if err != nil {
panic(err)
}
2014-02-12 10:29:20 -06:00
}
}
w.Hide()
}