mirror of https://github.com/rivo/tview.git
Clarified the "changed" callback trigger mechanism of a TreeView.
This commit is contained in:
parent
646df2bd7e
commit
becbc92f00
|
@ -345,7 +345,9 @@ func (t *TreeView) GetRoot() *TreeNode {
|
||||||
// selections. Selected nodes must be visible and selectable, or else the
|
// selections. Selected nodes must be visible and selectable, or else the
|
||||||
// selection will be changed to the top-most selectable and visible node.
|
// selection will be changed to the top-most selectable and visible node.
|
||||||
//
|
//
|
||||||
// This function does NOT trigger the "changed" callback.
|
// This function does NOT trigger the "changed" callback because the actual node
|
||||||
|
// that will be selected is not known until the tree is drawn. That is also when
|
||||||
|
// the "changed" callback will be triggered.
|
||||||
func (t *TreeView) SetCurrentNode(node *TreeNode) *TreeView {
|
func (t *TreeView) SetCurrentNode(node *TreeNode) *TreeView {
|
||||||
t.currentNode = node
|
t.currentNode = node
|
||||||
return t
|
return t
|
||||||
|
|
Loading…
Reference in New Issue