new-gui/cmds/helloworld/main.go

26 lines
385 B
Go
Raw Normal View History

// This is a simple example
2022-10-11 11:25:46 -05:00
package main
import (
"log"
2022-10-11 11:25:46 -05:00
"git.wit.org/wit/gui"
)
func main() {
gui.Init()
gui.Main(helloworld)
2022-10-11 11:25:46 -05:00
}
// This creates a window
func helloworld() {
var w *gui.Node
gui.Config.Title = "helloworld golang wit/gui window"
2022-10-11 11:25:46 -05:00
gui.Config.Width = 640
gui.Config.Height = 480
w = gui.NewWindow()
w.NewButton("hello", func () {
log.Println("world")
})
2022-10-11 11:25:46 -05:00
}