Skip to content

Commit

Permalink
Add SelectedNode method
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor German committed Jun 10, 2019
1 parent 7357ed4 commit 81435f7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions widgets/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
self.ScrollAmount(-1)
}
Expand Down

0 comments on commit 81435f7

Please sign in to comment.