diff options
Diffstat (limited to 'addNode.go')
| -rw-r--r-- | addNode.go | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -45,3 +45,18 @@ func (me *TreeInfo) AddNode(a *widget.Action) *Node { p.children = append(p.children, n) return n } + +func (n *Node) DeleteNode() { + p := n.Parent + for i, child := range p.children { + log.Warn("parent has child:", i, child.WidgetId, child.GetProgName()) + if n == child { + log.Warn("Found child ==", i, child.WidgetId, child.GetProgName()) + log.Warn("Found n ==", i, n.WidgetId, n.GetProgName()) + p.children = append(p.children[:i], p.children[i+1:]...) + } + } + for i, child := range p.children { + log.Warn("parent now has child:", i, child.WidgetId, child.GetProgName()) + } +} |
