From db1c6c5c17efa0aa160de1bdf8193f984197f658 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sun, 2 Mar 2014 16:46:27 -0500 Subject: Added an alternate textsel for Mac OS X Comboboxes. --- sysdata_darwin.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sysdata_darwin.go') diff --git a/sysdata_darwin.go b/sysdata_darwin.go index 980a01f..8966324 100644 --- a/sysdata_darwin.go +++ b/sysdata_darwin.go @@ -23,6 +23,7 @@ type classData struct { hide func(what C.id) settextsel C.SEL textsel C.SEL + alttextsel C.SEL } var ( @@ -245,10 +246,14 @@ if classTypes[s.ctype].make == nil { return false } func (s *sysData) text() string { var zero C.SEL if classTypes[s.ctype].textsel == zero { return "" } + sel := classTypes[s.ctype].textsel + if s.alternate { + sel = classTypes[s.ctype].alttextsel + } ret := make(chan string) defer close(ret) uitask <- func() { - str := C.objc_msgSend_noargs(s.id, classTypes[s.ctype].textsel) + str := C.objc_msgSend_noargs(s.id, sel) ret <- fromNSString(str) } return <-ret -- cgit v1.2.3