From becbc92f00ef367dde2cf95247d44bf1eaa452b7 Mon Sep 17 00:00:00 2001 From: Oliver <480930+rivo@users.noreply.github.com> Date: Sat, 25 Mar 2023 21:34:35 +0100 Subject: [PATCH] Clarified the "changed" callback trigger mechanism of a TreeView. --- treeview.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/treeview.go b/treeview.go index c6cbc35..77bce5b 100644 --- a/treeview.go +++ b/treeview.go @@ -345,7 +345,9 @@ func (t *TreeView) GetRoot() *TreeNode { // selections. Selected nodes must be visible and selectable, or else the // 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 { t.currentNode = node return t