diff options
| author | Pietro Gagliardi <[email protected]> | 2014-04-12 22:05:34 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-04-12 22:05:34 -0400 |
| commit | d4c79539af8b33f41c070773c6bc5e5cbf867543 (patch) | |
| tree | 43a7eb1de1892a58774752bc56cd10b63050b405 /sysdata_darwin.go | |
| parent | 274fa0c2928e3d1573a83d2f68048963df5e16e4 (diff) | |
Fixed Listboxes on Mac OS X having an initial selection.
Diffstat (limited to 'sysdata_darwin.go')
| -rw-r--r-- | sysdata_darwin.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sysdata_darwin.go b/sysdata_darwin.go index cfbd00e..12b6b12 100644 --- a/sysdata_darwin.go +++ b/sysdata_darwin.go @@ -34,6 +34,7 @@ type classData struct { delete func(id C.id, index int) len func(id C.id) int selectIndex func(id C.id, index int, alternate bool) + selectIndices func(id C.id, indices []int) } var ( @@ -304,6 +305,7 @@ var classTypes = [nctypes]*classData{ selTexts: selectedListboxTexts, delete: deleteListbox, len: listboxLen, + selectIndices: selectListboxIndices, }, c_progressbar: &classData{ make: func(parentWindow C.id, alternate bool) C.id { @@ -571,3 +573,13 @@ func (s *sysData) selectIndex(index int) { } <-ret } + +func (s *sysData) selectIndices(indices []int) { + ret := make(chan struct{}) + defer close(ret) + uitask <- func() { + classTypes[s.ctype].selectIndices(s.id, indices) + ret <- struct{}{} + } + <-ret +} |
