summaryrefslogtreecommitdiff
path: root/main.go
blob: d501c961cfe0bd45b4b947b5afafe4775edb1c84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// 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()
	myGui.LoadToolkit("nocui")

	helloworld()
	gui.Watchdog()
}

// This initializes the first window, a group and a button
func helloworld() {
	window := myGui.NewWindow("hello world")

	box := window.NewBox("bw vbox", false)
	group := box.NewGroup("foo bar")
	group.NewButton("hello", func() {
		log.Println("world")
	})
}