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

Function IsRoot

tree/admin.go:118–120  ·  view source on GitHub ↗

IsRoot returns whether the given node is the root node in its tree.

(n Node)

Source from the content-addressed store, hash-verified

116
117// IsRoot returns whether the given node is the root node in its tree.
118func IsRoot(n Node) bool {
119 return n.AsTree().Parent == nil
120}
121
122// Root returns the root node of the given node's tree.
123func Root(n Node) Node {

Callers 9

resetStyleSettingsMethod · 0.92
ValidateMethod · 0.92
WriteGrammarMethod · 0.92
ValidateMethod · 0.92
WriteGrammarMethod · 0.92
ParentByNameMethod · 0.85
WalkUpParentMethod · 0.85
ParentByTypeFunction · 0.85
RootFunction · 0.85

Calls 1

AsTreeMethod · 0.65

Tested by

no test coverage detected