2022-11-06 12:59:24 -06:00
|
|
|
// This is a simple example
|
2022-10-11 11:25:46 -05:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2022-10-16 08:07:13 -05:00
|
|
|
"log"
|
2022-10-11 11:25:46 -05:00
|
|
|
"git.wit.org/wit/gui"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2023-02-25 14:05:25 -06:00
|
|
|
// gui.Init()
|
2022-11-06 12:59:24 -06:00
|
|
|
gui.Main(helloworld)
|
2022-10-11 11:25:46 -05:00
|
|
|
}
|
|
|
|
|
2022-11-06 12:59:24 -06:00
|
|
|
// This creates a window
|
|
|
|
func helloworld() {
|
2022-10-19 13:23:22 -05:00
|
|
|
var w *gui.Node
|
2022-11-06 12:59:24 -06:00
|
|
|
gui.Config.Title = "helloworld golang wit/gui window"
|
2022-10-11 11:25:46 -05:00
|
|
|
gui.Config.Width = 640
|
|
|
|
gui.Config.Height = 480
|
2022-10-16 08:07:13 -05:00
|
|
|
|
2022-10-19 13:23:22 -05:00
|
|
|
w = gui.NewWindow()
|
2022-11-06 12:59:24 -06:00
|
|
|
w.NewButton("hello", func () {
|
|
|
|
log.Println("world")
|
|
|
|
})
|
2022-10-11 11:25:46 -05:00
|
|
|
}
|