mirror of https://github.com/gizak/termui.git
Add SelectedNode method
This commit is contained in:
parent
7357ed4649
commit
81435f79b5
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue