summaryrefslogtreecommitdiff
path: root/andlabs/add.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-17 21:31:49 -0600
committerJeff Carr <[email protected]>2024-01-17 21:31:49 -0600
commit841e6252c95244f0ee7faf2c01d33f69a8ab483a (patch)
treeef400228622b87611168db2227269ba7fd56625d /andlabs/add.go
parentba95c13799740b5f55541fc5e8ab9f1d34f7e421 (diff)
common tree package for toolkitsv0.12.4
This update provides *lots* of toolkit updates. This will allow the next step of debugging the gocui toolkit to make it work again. There are new common routines for handling the plugin channel communication Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'andlabs/add.go')
-rw-r--r--andlabs/add.go58
1 files changed, 34 insertions, 24 deletions
diff --git a/andlabs/add.go b/andlabs/add.go
index ffe2cc4..a47d697 100644
--- a/andlabs/add.go
+++ b/andlabs/add.go
@@ -6,57 +6,67 @@ import (
)
func add(a *widget.Action) {
+ log.Warn("andlabs add()", a.WidgetId, a.State.ProgName)
if (a.WidgetType == widget.Root) {
- me.rootNode = addNode(a)
+ if me.treeRoot == nil {
+ me.treeRoot = me.myTree.AddNode(a)
+ }
return
}
- n := addNode(a)
+ // n := addNode(a)
+ n := me.myTree.AddNode(a)
- p := n.parent
+ p := n.Parent
switch n.WidgetType {
case widget.Window:
- newWindow(n)
+ log.Warn("SPEEDY Add window", n.WidgetId, n.GetProgName())
+ newWindow(p, n)
return
+ case widget.Group:
+ log.Warn("SPEEDY Add Group", n.WidgetId, n.GetProgName())
+ newGroup(p, n)
+ return
+ case widget.Grid:
+ newGrid(n)
+ return
+ case widget.Box:
+ newBox(n)
+ return
+ /*
case widget.Tab:
- p.newTab(n)
+ newTab(n)
return
+ */
case widget.Label:
- p.newLabel(n)
+ newLabel(p, n)
return
case widget.Button:
- p.newButton(n)
- return
- case widget.Grid:
- p.newGrid(n)
+ newButton(p, n)
return
case widget.Checkbox:
- p.newCheckbox(n)
+ newCheckbox(p, n)
return
case widget.Spinner:
- p.newSpinner(n)
+ newSpinner(p, n)
return
case widget.Slider:
- p.newSlider(n)
+ newSlider(p, n)
return
case widget.Dropdown:
- p.newDropdown(n)
+ newDropdown(p, n)
return
case widget.Combobox:
- p.newCombobox(n)
+ newCombobox(p, n)
return
case widget.Textbox:
- p.newTextbox(n)
- return
- case widget.Group:
- p.newGroup(n)
- return
- case widget.Box:
- p.newBox(n)
+ newTextbox(p, n)
return
+ /*
case widget.Image:
- p.newImage(n)
+ newImage(p, n)
return
+ */
default:
- log.Log(ERROR, "add() error TODO: ", n.WidgetType, n.progname)
+ log.Log(ERROR, "add() error TODO: ", n.WidgetType, n.State.ProgName)
}
}