summaryrefslogtreecommitdiff
path: root/sysdata_windows.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-02-15 14:05:10 -0500
committerPietro Gagliardi <[email protected]>2014-02-15 14:05:10 -0500
commitc67191094f80c7b80de36d91f22bb3e69cb4a6a3 (patch)
treea4e2d476cad7d48d5933431066fc1fb739ffd773 /sysdata_windows.go
parent063293456d929ffab90b8b8c9e609083644b04a1 (diff)
Made sure sysData.selectedIndices() returns an empty slice if nothing was selected in a single-selection listbox.
Diffstat (limited to 'sysdata_windows.go')
-rw-r--r--sysdata_windows.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/sysdata_windows.go b/sysdata_windows.go
index 7458f45..42c8f94 100644
--- a/sysdata_windows.go
+++ b/sysdata_windows.go
@@ -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)