blob: cffddde0d4059dcf42c94e913bb1bbb500fc3dd3 (
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
  | 
// This window, when it's hidden, still exists to the application
// so it can be treated as if it really exists
package main
import (
	"go.wit.com/gui"
	"go.wit.com/lib/gadgets"
	"go.wit.com/log"
)
var apple *gui.Node
// This initializes the first window, a group and a button
func makebasicWindow() *gadgets.BasicWindow {
	log.Warn("start basicWindow")
	basicWindow = gadgets.NewBasicWindow(myGui, "basic window test")
	basicWindow.Custom = func() {
		log.Info("got to close")
	}
	basicWindow.Make()
	basicWindow.StandardClose()
	box1 := basicWindow.Box()
	section2 = newChoices(box1)
	vbox := box1.NewBox("vbox", false)
	group1 := vbox.NewGroup("controls").Horizontal() // Vertical()
	group1.NewButton("hide apple", func() {
		apple.Hide()
	})
	group1.NewButton("show apple", func() {
		apple.Show()
	})
	group1.NewButton("hide computers", func() {
		section2.computers.Hide()
	})
	group1.NewButton("show computers", func() {
		section2.computers.Show()
	})
	apple = group1.NewButton("apple", func() {
		log.Info("is not a pear")
	})
	return basicWindow
}
  |