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

Method SyncTree

core/treesync.go:28–36  ·  view source on GitHub ↗

note: see this file has all the SyncNode specific functions for Tree. SyncTree sets the root [Tree.SyncNode] to the root of the given [tree.Node] and synchronizes the rest of the tree to match. The source tree must have unique names for each child within a given parent.

(n tree.Node)

Source from the content-addressed store, hash-verified

26// and synchronizes the rest of the tree to match. The source tree must have
27// unique names for each child within a given parent.
28func (tr *Tree) SyncTree(n tree.Node) *Tree {
29 if tr.SyncNode != n {
30 tr.SyncNode = n
31 }
32 tvIndex := 0
33 tr.syncToSrc(&tvIndex, true, 0)
34 tr.Update()
35 return tr
36}
37
38// setSyncNode sets the sync source node that we are viewing,
39// and syncs the view of its tree. It is called routinely

Callers 4

TestTreeFunction · 0.80
TestTreeReadOnlyFunction · 0.80
InitMethod · 0.80
ConfigGUIMethod · 0.80

Calls 2

syncToSrcMethod · 0.95
UpdateMethod · 0.65

Tested by 2

TestTreeFunction · 0.64
TestTreeReadOnlyFunction · 0.64