Add SelectedNode method

This commit is contained in:
Igor German 2019-06-10 16:09:26 +03:00
parent 7357ed4649
commit 81435f79b5

View File

@ -173,6 +173,13 @@ func (self *Tree) ScrollAmount(amount int) {
} }
} }
func (self *Tree) SelectedNode() *TreeNode {
if len(self.rows) == 0 {
return nil
}
return self.rows[self.SelectedRow]
}
func (self *Tree) ScrollUp() { func (self *Tree) ScrollUp() {
self.ScrollAmount(-1) self.ScrollAmount(-1)
} }