summaryrefslogtreecommitdiff
path: root/sysdata_windows.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-02-15 18:36:14 -0500
committerPietro Gagliardi <[email protected]>2014-02-15 18:36:42 -0500
commit992d43ac7b93353448250fade4c0d68ee3160758 (patch)
treeeca0070637c407d91abc8cd82f1539e38705f20d /sysdata_windows.go
parent2d97a2446304daa1d57121d13143cce2ceaf69a3 (diff)
Added Listbox.Selection() and Listbox.SelectedIndices(). Also fixed a bug involving sysData.selectedIndices() with nothing selected.
Diffstat (limited to 'sysdata_windows.go')
-rw-r--r--sysdata_windows.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/sysdata_windows.go b/sysdata_windows.go
index 52e2806..7a5abae 100644
--- a/sysdata_windows.go
+++ b/sysdata_windows.go
@@ -385,6 +385,9 @@ func (s *sysData) selectedIndices() []int {
if r.ret == uintptr(_LB_ERR) {
panic("UI library internal error: LB_ERR from LB_GETSELCOUNT in what we know is a multi-selection listbox")
}
+ if r.ret == 0 { // nothing selected
+ return nil
+ }
indices := make([]int, r.ret)
uitask <- &uimsg{
call: _sendMessage,