summaryrefslogtreecommitdiff
path: root/toolkit/andlabs/box.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-04-27 12:41:42 -0500
committerJeff Carr <[email protected]>2023-04-27 12:41:42 -0500
commit253dcb012f6d4fc861e6fc9a66fd2c7260ead442 (patch)
treea3092695fa5d6769d5898e3319016f0bb84ae6e9 /toolkit/andlabs/box.go
parent8100e7a1abdc31afbf65af6d0b7cd7cb0fff69eb (diff)
andlabs: deprecate old code
Signed-off-by: Jeff Carr <[email protected]>
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)
}