Added basic window example
This commit is contained in:
parent
1e5aa3b5d1
commit
1478f59740
|
@ -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()
|
||||
}
|
Loading…
Reference in New Issue