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

Method DeleteChildAt

tree/nodebase.go:338–346  ·  view source on GitHub ↗

Deleting Children: DeleteChildAt deletes child at the given index. It returns false if there is no child at the given index.

(index int)

Source from the content-addressed store, hash-verified

336// DeleteChildAt deletes child at the given index. It returns false
337// if there is no child at the given index.
338func (n *NodeBase) DeleteChildAt(index int) bool {
339 child := n.Child(index)
340 if child == nil {
341 return false
342 }
343 n.Children = slices.Delete(n.Children, index, index+1)
344 child.Destroy()
345 return true
346}
347
348// DeleteChild deletes the given child node, returning false if
349// it can not find it.

Callers 4

DeleteChildMethod · 0.95
DeleteChildByNameMethod · 0.95
applyContextMenusMethod · 0.80
deleteTabIndexMethod · 0.80

Calls 3

ChildMethod · 0.95
DeleteMethod · 0.65
DestroyMethod · 0.65

Tested by

no test coverage detected