blob: 39b64b0fe8defc7ea8d3695cb26ee3b9fa02990d (
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
|
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 (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
}
|