diff options
| author | Jeff Carr <[email protected]> | 2024-02-09 10:26:42 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-02-09 10:26:42 -0600 |
| commit | ec829f6e2be515b717d0ebd20b56623e44aff810 (patch) | |
| tree | 77551f22d4ffcdbdc54d10ee94e1c1230eec5693 /addNode.go | |
| parent | 12829e6e1c193bf7e98d9b13129d16c862995491 (diff) | |
binary tree is global
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'addNode.go')
| -rw-r--r-- | addNode.go | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -24,19 +24,19 @@ func (me *TreeInfo) AddNode(a *widget.Action) *Node { if a.WidgetType == widget.Root { log.Log(TREE, "AddNode() Root") n.Parent = n - me.treeRoot = n + treeRoot = n return n } - if me.treeRoot.FindWidgetId(a.WidgetId) != nil { + if treeRoot.FindWidgetId(a.WidgetId) != nil { log.Log(TREEWARN, "AddNode() WidgetId already exists", a.WidgetId) log.Log(TREEWARN, "probably this is a Show() / Hide() issue") log.Log(TREEWARN, "TODO: figure out what to do here") - return me.treeRoot.FindWidgetId(a.WidgetId) + return treeRoot.FindWidgetId(a.WidgetId) } // add this new widget on the binary tree - p := me.treeRoot.FindWidgetId(a.ParentId) + p := treeRoot.FindWidgetId(a.ParentId) n.Parent = p if n.Parent == nil { log.Log(TREEWARN, "AddNode() ERROR n.Parent == nil n =", n.WidgetId, n.WidgetType, n.GetProgName()) |
