From 2d97a2446304daa1d57121d13143cce2ceaf69a3 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sat, 15 Feb 2014 18:27:34 -0500 Subject: Added Combobox.SelectedIndex(). --- sysdata_windows.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'sysdata_windows.go') diff --git a/sysdata_windows.go b/sysdata_windows.go index f0ecbf3..52e2806 100644 --- a/sysdata_windows.go +++ b/sysdata_windows.go @@ -340,7 +340,6 @@ func (s *sysData) insertBefore(what string, index int) (err error) { return nil } -// TODO differentiate between nothing selected and custom text entered for a Combobox func (s *sysData) selectedIndex() int { ret := make(chan uiret) defer close(ret) @@ -355,7 +354,7 @@ func (s *sysData) selectedIndex() int { ret: ret, } r := <-ret - if r.ret == uintptr(classTypes[s.ctype].selectedIndexErr) { // no selection + if r.ret == uintptr(classTypes[s.ctype].selectedIndexErr) { // no selection or manually entered text (apparently, for the latter) return -1 } return int(r.ret) -- cgit v1.2.3