summaryrefslogtreecommitdiff
path: root/toolkit/andlabs/box.go
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/andlabs/box.go')
-rw-r--r--toolkit/andlabs/box.go23
1 files changed, 5 insertions, 18 deletions
diff --git a/toolkit/andlabs/box.go b/toolkit/andlabs/box.go
index 72ff698..0a6b7e4 100644
--- a/toolkit/andlabs/box.go
+++ b/toolkit/andlabs/box.go
@@ -9,26 +9,12 @@ import (
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
+ newt := new(andlabsT)
var box *ui.Box
- newt.Name = title
log(debugToolkit, "rawBox() create", newt.Name)
- if (b) {
+ if (n.B) {
box = ui.NewHorizontalBox()
} else {
box = ui.NewVerticalBox()
@@ -37,6 +23,7 @@ func (t *andlabsT) rawBox(title string, b bool) *andlabsT {
newt.uiBox = box
newt.uiControl = box
-
- return &newt
+ newt.boxC = 0
+ n.tk = newt
+ p.place(n)
}