blob: 72ff69873107bfb67c0effaf6f97dca577ceff10 (
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
|
package main
import (
"github.com/andlabs/ui"
_ "github.com/andlabs/ui/winmanifest"
)
// make new Box here
func (p *node) newBox(n *node) {
log(debugToolkit, "newBox()", n.Name)
t := p.tk
if (t == nil) {
log(debugToolkit, "newBox() toolkit struct == nil. name=", n.Name)
listMap(debugToolkit)
}
newt := t.rawBox(n.Text, n.B)
newt.boxC = 0
n.tk = newt
p.place(n)
}
// make new Box using andlabs/ui
func (t *andlabsT) rawBox(title string, b bool) *andlabsT {
var newt andlabsT
var box *ui.Box
newt.Name = title
log(debugToolkit, "rawBox() create", newt.Name)
if (b) {
box = ui.NewHorizontalBox()
} else {
box = ui.NewVerticalBox()
}
box.SetPadded(padded)
newt.uiBox = box
newt.uiControl = box
return &newt
}
|