blob: b5ea0b8d1b5edc6934705f982c1b98647e09f06d (
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
  | 
/*
Attempt to make a VPN
Take a look at: https://github.com/skx/simple-vpn
*/
package main
import (
	"go.wit.com/log"
	"go.wit.com/gui"
	"go.wit.com/lib/gadgets"
)
var myGui *gui.Node
var win *gadgets.BasicWindow
func main() {
	myGui = gui.New().Default()
	myGui.LoadToolkit("andlabs")
	helloworld()
	log.Sleep(1)
	win.Toggle()
	log.Sleep(1)
	win.Toggle()
	log.Sleep(1)
	win.Toggle()
	// This is just a optional goroutine to watch that things are alive
	gui.Watchdog()
}
// This creates a window
func helloworld() {
	win = gadgets.NewBasicWindow(myGui, "helloworld golang wit/gui window")
	win.Make()
	win.Draw()
	win.Box().NewButton("hello", func() {
		log.Println("world")
		hellosmart()
	})
}
// This creates a window
func hellosmart() {
	win := gadgets.NewBasicWindow(myGui, "helloworld golang wit/gui window")
	win.Make()
	win.Draw()
	win.Box().NewButton("hello", func() {
		log.Println("smart")
	})
}
  |