summaryrefslogtreecommitdiff
path: root/cmds/buttonAsPlugin/main.go
blob: 1c2eeaf6644c49915ffdba4a65921345f736f9e5 (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
30
31
32
33
// This is a simple example
package main

import 	(
	"log"
	"git.wit.org/wit/gui"
)

func main() {
	gui.Main(buttonWindow)
}

// This creates a window
func buttonWindow() {
	var w, g *gui.Node
	gui.Config.Title = "Demo Plugin Window"
	gui.Config.Width = 640
	gui.Config.Height = 480

//	gui.Config.Exit = gui.StandardClose
//	gui.SetDebug(true)

	w = gui.NewWindow()
	g = w.NewGroup("buttonGroup")

	g.NewButton("hello", func () {
		log.Println("world")
	})

	g.NewButton("foo", func () {
		log.Println("bar")
	})
}