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)
| 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. |
| 28 | func (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 |