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

Method DeleteChildren

tree/nodebase.go:372–381  ·  view source on GitHub ↗

DeleteChildren deletes all children nodes.

()

Source from the content-addressed store, hash-verified

370
371// DeleteChildren deletes all children nodes.
372func (n *NodeBase) DeleteChildren() {
373 kids := n.Children
374 n.Children = n.Children[:0] // preserves capacity of list
375 for _, kid := range kids {
376 if kid == nil {
377 continue
378 }
379 kid.Destroy()
380 }
381}
382
383// Delete deletes this node from its parent's children list
384// and then destroys itself.

Callers 10

DestroyMethod · 0.95
UnmarshalJSONMethod · 0.95
OpenURLMethod · 0.80
deleteMethod · 0.80
ParseFileMethod · 0.80
InitMethod · 0.80
DestroyMethod · 0.80
BindTextEditorFunction · 0.80
DeleteAllMethod · 0.80
copyFromFunction · 0.80

Calls 1

DestroyMethod · 0.65

Tested by

no test coverage detected