summaryrefslogtreecommitdiff
path: root/add.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-19 12:18:11 -0600
committerJeff Carr <[email protected]>2024-01-19 12:18:11 -0600
commitf48b950655f57cb02bbd754ba0043a953956f888 (patch)
tree7547dd1b167536fe9cb4c6f42e6675b5ac0d89d1 /add.go
parentc2a563ae37d11f8374df6c7f00661369f4d5a76f (diff)
things are moving to widget.Statev0.0.9
pass borderless windows correctly destroy themselves from the binary tree checkbox state cleanups Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'add.go')
-rw-r--r--add.go24
1 files changed, 4 insertions, 20 deletions
diff --git a/add.go b/add.go
index 8a404fb..a2866a5 100644
--- a/add.go
+++ b/add.go
@@ -2,16 +2,17 @@ package main
import (
"go.wit.com/log"
+ "go.wit.com/toolkits/tree"
"go.wit.com/widget"
)
-func add(a *widget.Action) {
+func add(a *widget.Action) *tree.Node {
log.Warn("andlabs add()", a.WidgetId, a.State.ProgName)
if a.WidgetType == widget.Root {
if me.treeRoot == nil {
me.treeRoot = me.myTree.AddNode(a)
}
- return
+ return me.treeRoot
}
n := me.myTree.AddNode(a)
@@ -20,52 +21,35 @@ func add(a *widget.Action) {
case widget.Window:
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:
- newTab(n)
- return
- */
case widget.Label:
newLabel(p, n)
- return
case widget.Button:
newButton(p, n)
- return
case widget.Checkbox:
newCheckbox(p, n)
- return
case widget.Spinner:
newSpinner(p, n)
- return
case widget.Slider:
newSlider(p, n)
- return
case widget.Dropdown:
newDropdown(p, n)
- return
case widget.Combobox:
newCombobox(p, n)
- return
case widget.Textbox:
newTextbox(p, n)
- return
/*
case widget.Image:
newImage(p, n)
- return
*/
default:
log.Log(ERROR, "add() error TODO: ", n.WidgetType, n.State.ProgName)
}
+ return n
}