andlabs-ui/main.go

28 lines
402 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")
w.SetControl(b)
err := w.Open()
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.Close()
}