blob: 9e186b41e2ad2337d63c8bdc8cc293516da16439 (
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
|
// This is a simple example
package main
import (
"log"
"go.wit.com/gui/gui"
"go.wit.com/gui/gadgets"
"go.wit.com/control-panels/dns/smartwindow"
)
var myGui *gui.Node
func main() {
myGui = gui.New().Default()
helloworld()
// hellosmart()
// 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.Box().NewButton("hello", func () {
log.Println("world")
})
}
// This creates a window
func hellosmart() {
myGui = gui.New().Default()
win := smartwindow.New()
win.Title("helloworld golang wit/gui window")
win.Vertical()
win.Draw()
win.Box().NewButton("hello", func () {
log.Println("world")
})
}
|