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

Method Close

core/tree.go:1096–1105  ·  view source on GitHub ↗

Close closes the given node and updates the tree accordingly (if it is not already closed). It calls OnClose in the [Treer] interface for extensible actions.

()

Source from the content-addressed store, hash-verified

1094// (if it is not already closed). It calls OnClose in the [Treer]
1095// interface for extensible actions.
1096func (tr *Tree) Close() {
1097 if tr.Closed {
1098 return
1099 }
1100 tr.SetClosed(true)
1101 tr.setBranchState()
1102 tr.This.(Treer).OnClose()
1103 tr.setChildrenVisibility(true) // parent closed
1104 tr.NeedsLayout()
1105}
1106
1107// OnOpen is called when a node is opened.
1108// The base version does nothing.

Callers 3

DeleteNodeMethod · 0.95
InitMethod · 0.95
ToggleCloseMethod · 0.95

Calls 5

SetClosedMethod · 0.95
setBranchStateMethod · 0.95
setChildrenVisibilityMethod · 0.95
OnCloseMethod · 0.65
NeedsLayoutMethod · 0.45

Tested by

no test coverage detected