helloworld/main.go

28 lines
530 B
Go
Raw Normal View History

2024-01-16 16:37:43 -06:00
// This creates a simple hello world window
package main
import (
"go.wit.com/log"
"go.wit.com/gui/gui"
)
var myGui *gui.Node // This is the beginning of the binary tree of widgets
// go will sit here until the window exits
func main() {
myGui = gui.New().Default()
helloworld()
gui.Watchdog()
}
// This initializes the first window, a group and a button
func helloworld() {
window := myGui.NewWindow("hello world")
group := window.NewGroup("foo bar")
group.NewButton("hello", func() {
log.Println("world")
})
}