MCPcopy Create free account
hub / github.com/cogentcore/core / DeleteChild

Method DeleteChild

tree/nodebase.go:350–359  ·  view source on GitHub ↗

DeleteChild deletes the given child node, returning false if it can not find it.

(child Node)

Source from the content-addressed store, hash-verified

348// DeleteChild deletes the given child node, returning false if
349// it can not find it.
350func (n *NodeBase) DeleteChild(child Node) bool {
351 if child == nil {
352 return false
353 }
354 idx := IndexOf(n.Children, child)
355 if idx < 0 {
356 return false
357 }
358 return n.DeleteChildAt(idx)
359}
360
361// DeleteChildByName deletes child node by name, returning false
362// if it can not find it.

Callers 2

TestNodeDeleteChildFunction · 0.95
DeleteMethod · 0.80

Calls 2

DeleteChildAtMethod · 0.95
IndexOfFunction · 0.85

Tested by 1

TestNodeDeleteChildFunction · 0.76