blob: 2968b7f0ed8c967e4e061538bcd947e836478525 (
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
package gui
import (
"go.wit.com/widget"
)
func (parent *Node) NewBox(progname string, b bool) *Node {
newNode := parent.newNode(progname, widget.Box)
newNode.progname = progname
if b {
newNode.direction = widget.Horizontal
} else {
newNode.direction = widget.Vertical
}
// inform the toolkits
sendAction(newNode, widget.Add)
return newNode
}
func (parent *Node) Box() *Node {
newNode := parent.newNode("BOX", widget.Box)
// inform the toolkits
sendAction(newNode, widget.Add)
return newNode
}
// this is an experiment. I like to think of this package like 'Sierpinski'
// It's like it's in a fractional dimension because it doesn't exist
// the toolkits are the things that make it visible to us. Here, we can
// think abstractly about how the data is formed
// make something that can't be seen at all
func RawBox() *Node {
newNode := me.rootNode.newNode("BOX", widget.Box)
return newNode
}
func (n *Node) Vertical() *Node {
n.direction = widget.Horizontal
return n
}
func (n *Node) Horizontal() *Node {
n.direction = widget.Horizontal
return n
}
func (parent *Node) NewHorizontalBox(progname string) *Node {
newNode := parent.newNode(progname, widget.Box)
newNode.progname = progname
newNode.direction = widget.Horizontal
// inform the toolkits
sendAction(newNode, widget.Add)
return newNode
}
func (parent *Node) NewVerticalBox(progname string) *Node {
newNode := parent.newNode(progname, widget.Box)
newNode.progname = progname
newNode.direction = widget.Vertical
// inform the toolkits
sendAction(newNode, widget.Add)
return newNode
}
|