summaryrefslogtreecommitdiff
path: root/cmds/plugin-consoleonly/main.go
blob: fa428d6a28d01a6bb6f79774cb3cd8a63e6c72a4 (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.InitPlugins([]string{"gocui"})
	gui.Main(helloworld)
}

// This creates a window
func helloworld() {
	var w *gui.Node
	gui.Config.Title = "helloworld golang wit/gui window"
	gui.Config.Width = 640
	gui.Config.Height = 480

	w = gui.NewWindow()
	w.NewButton("hello", func () {
		log.Println("world")
	})
	w.NewButton("Flags", func () {
		log.Println("the debugging flags window")
		w.DebugFlags(false)
	})
	w.NewButton("Widgets", func () {
		w.DebugWidgets(false)
		log.Println("debug the widgets window")
	})
}