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

Method ChildByName

tree/nodebase.go:213–215  ·  view source on GitHub ↗

ChildByName returns the first child that has the given name, and nil if no such element is found. startIndex arg allows for optimized bidirectional find if you have an idea where it might be, which can be a key speedup for large lists. If no value is specified for startIndex, it starts in the middle

(name string, startIndex ...int)

Source from the content-addressed store, hash-verified

211// can be a key speedup for large lists. If no value is specified for
212// startIndex, it starts in the middle, which is a good default.
213func (n *NodeBase) ChildByName(name string, startIndex ...int) Node {
214 return n.Child(IndexByName(n.Children, name, startIndex...))
215}
216
217// Paths:
218

Callers 15

findDirNodeMethod · 0.80
externalNodeByPathMethod · 0.80
dirsToMethod · 0.80
TestTabsNewClickFunction · 0.80
addSyncNodesMethod · 0.80
duplicateSyncMethod · 0.80
pasteAtSyncMethod · 0.80
pasteAtMethod · 0.80
ApplyScenePosMethod · 0.80
SetTitleMethod · 0.80
GetBarMethod · 0.80
openMenuMethod · 0.80

Calls 2

ChildMethod · 0.95
IndexByNameFunction · 0.85

Tested by 1

TestTabsNewClickFunction · 0.64