Skip to content

Commit

Permalink
Add SelectedNode method
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor German authored and cjbassi committed Jul 15, 2019
1 parent 691e2f0 commit e3d12be
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 e3d12be

Please sign in to comment.