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

Method Open

core/tree.go:1121–1134  ·  view source on GitHub ↗

Open opens the given node and updates the tree accordingly (if it is not already opened). It calls OnOpen in the [Treer] interface for extensible actions.

()

Source from the content-addressed store, hash-verified

1119// (if it is not already opened). It calls OnOpen in the [Treer]
1120// interface for extensible actions.
1121func (tr *Tree) Open() {
1122 if !tr.Closed || tr.inOpen || tr.This == nil {
1123 return
1124 }
1125 tr.inOpen = true
1126 if tr.This.(Treer).CanOpen() {
1127 tr.SetClosed(false)
1128 tr.setBranchState()
1129 tr.setChildrenVisibility(false)
1130 tr.This.(Treer).OnOpen()
1131 }
1132 tr.inOpen = false
1133 tr.NeedsLayout()
1134}
1135
1136// ToggleClose toggles the close / open status: if closed, opens, and vice-versa.
1137func (tr *Tree) ToggleClose() {

Callers 6

OpenPathMethod · 0.95
addTreeNodesMethod · 0.95
InitMethod · 0.95
ToggleCloseMethod · 0.95
pasteAssignMethod · 0.95
pasteChildrenMethod · 0.95

Calls 6

SetClosedMethod · 0.95
setBranchStateMethod · 0.95
setChildrenVisibilityMethod · 0.95
CanOpenMethod · 0.65
OnOpenMethod · 0.65
NeedsLayoutMethod · 0.45

Tested by

no test coverage detected