diff options
| author | Pietro Gagliardi <[email protected]> | 2014-02-15 18:36:14 -0500 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-02-15 18:36:42 -0500 |
| commit | 992d43ac7b93353448250fade4c0d68ee3160758 (patch) | |
| tree | eca0070637c407d91abc8cd82f1539e38705f20d /sysdata_windows.go | |
| parent | 2d97a2446304daa1d57121d13143cce2ceaf69a3 (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.go | 3 |
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, |
