summaryrefslogtreecommitdiff
path: root/add.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-17 23:54:19 -0600
committerJeff Carr <[email protected]>2024-01-17 23:54:19 -0600
commitb25f15ea7803e172204432082740d081e5f19f81 (patch)
tree025146f42287e7b5d91850366f7fccf49d8ced9b /add.go
the golang way. everything in it's own repov0.0.1
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'add.go')
-rw-r--r--add.go72
1 files changed, 72 insertions, 0 deletions
diff --git a/add.go b/add.go
new file mode 100644
index 0000000..c948b88
--- /dev/null
+++ b/add.go
@@ -0,0 +1,72 @@
+package main
+
+import (
+ "go.wit.com/lib/widget"
+ "go.wit.com/log"
+)
+
+func add(a *widget.Action) {
+ 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
+ }
+ // n := addNode(a)
+ n := me.myTree.AddNode(a)
+
+ p := n.Parent
+ switch n.WidgetType {
+ 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)
+ }
+}