2
0
mirror of https://github.com/rivo/tview.git synced 2024-11-11 01:10:41 +00:00

[#1004] feat: add GetSelectedFunc method for TreeView component

This commit is contained in:
Alexey Savchuk 2024-07-15 23:21:34 +03:00
parent 65571ae51e
commit 0f4bf9609c
No known key found for this signature in database

View File

@ -450,6 +450,12 @@ func (t *TreeView) SetSelectedFunc(handler func(node *TreeNode)) *TreeView {
return t
}
// GetSelectedFunc returns the function set with SetSelectedFunc() or nil
// if no such function has been set.
func (t *TreeView) GetSelectedFunc() func(node *TreeNode) {
return t.selected
}
// SetDoneFunc sets a handler which is called whenever the user presses the
// Escape, Tab, or Backtab key.
func (t *TreeView) SetDoneFunc(handler func(key tcell.Key)) *TreeView {