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

Method IsRoot

core/tree.go:1239–1247  ·  view source on GitHub ↗

IsRoot returns true if given node is the root of the tree, creating an error snackbar if it is and action is non-empty.

(action string)

Source from the content-addressed store, hash-verified

1237// IsRoot returns true if given node is the root of the tree,
1238// creating an error snackbar if it is and action is non-empty.
1239func (tr *Tree) IsRoot(action string) bool {
1240 if tr.This == tr.root.This {
1241 if action != "" {
1242 MessageSnackbar(tr, fmt.Sprintf("Cannot %v the root of the tree", action))
1243 }
1244 return true
1245 }
1246 return false
1247}
1248
1249////////////////////////////////////////////////////////////
1250// Copy / Cut / Paste

Callers 6

insertAtMethod · 0.95
DeleteNodeMethod · 0.95
DuplicateMethod · 0.95
CutMethod · 0.95
makePasteMenuMethod · 0.95
CutMethod · 0.80

Calls 1

MessageSnackbarFunction · 0.85

Tested by

no test coverage detected