Added basic window example

This commit is contained in:
Andrew Martin 2014-11-26 10:35:17 +11:00
parent 1e5aa3b5d1
commit 1478f59740
1 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,31 @@
package main
import (
"github.com/andlabs/ui"
"log"
)
func main() {
go ui.Do(gui)
err := ui.Go()
if err != nil {
log.Print(err)
}
}
func gui() {
// Here we create a new space
newControl := ui.Space()
// Then we create a window
w := ui.NewWindow("Window", 280, 350, newControl)
w.OnClosing(func() bool {
ui.Stop()
return true
})
w.Show()
}