Made sure sysData.selectedIndices() returns an empty slice if nothing was selected in a single-selection listbox.

This commit is contained in:
Pietro Gagliardi 2014-02-15 14:05:10 -05:00
parent 063293456d
commit c67191094f
1 changed files with 5 additions and 1 deletions

View File

@ -363,7 +363,11 @@ func (s *sysData) selectedIndex() int {
func (s *sysData) selectedIndices() []int {
if !s.alternate { // single-selection list box; use single-selection method
return []int{s.selectedIndex()}
index := s.selectedIndex()
if index == -1 {
return nil
}
return []int{index}
}
ret := make(chan uiret)