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

Method Delete

tree/nodebase.go:385–391  ·  view source on GitHub ↗

Delete deletes this node from its parent's children list and then destroys itself.

()

Source from the content-addressed store, hash-verified

383// Delete deletes this node from its parent's children list
384// and then destroys itself.
385func (n *NodeBase) Delete() {
386 if n.Parent == nil {
387 n.This.Destroy()
388 } else {
389 n.Parent.AsTree().DeleteChild(n.This)
390 }
391}
392
393// Destroy recursively deletes and destroys the node, all of its children,
394// and all of its children's children, etc.

Callers 1

UnmarshalJSONMethod · 0.95

Calls 3

DeleteChildMethod · 0.80
DestroyMethod · 0.65
AsTreeMethod · 0.65

Tested by

no test coverage detected