From 3279f4f43a195c1dab8e20801553ec8a229f2b24 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sun, 2 Mar 2014 14:43:31 -0500 Subject: [PATCH] Added the alternate value as a parameter to Mac OS X sysData.make() in preparation for Comboboxes and Listboxes. --- sysdata_darwin.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sysdata_darwin.go b/sysdata_darwin.go index 407927c..980a01f 100644 --- a/sysdata_darwin.go +++ b/sysdata_darwin.go @@ -18,7 +18,7 @@ type sysData struct { } type classData struct { - make func(parentWindow C.id) C.id + make func(parentWindow C.id, alternate bool) C.id show func(what C.id) hide func(what C.id) settextsel C.SEL @@ -61,7 +61,7 @@ func controlHide(what C.id) { var classTypes = [nctypes]*classData{ c_window: &classData{ - make: func(parentWindow C.id) C.id { + make: func(parentWindow C.id, alternate bool) C.id { const ( NSBorderlessWindowMask = 0 NSTitledWindowMask = 1 << 0 @@ -92,7 +92,7 @@ var classTypes = [nctypes]*classData{ textsel: _title, }, c_button: &classData{ - make: func(parentWindow C.id) C.id { + make: func(parentWindow C.id, alternate bool) C.id { button := objc_alloc(_NSButton) // NSControl requires that we specify a frame; dummy frame for now button = objc_msgSend_rect(button, _initWithFrame, @@ -110,7 +110,7 @@ var classTypes = [nctypes]*classData{ textsel: _title, }, c_checkbox: &classData{ - make: func(parentWindow C.id) C.id { + make: func(parentWindow C.id, alternate bool) C.id { checkbox := objc_alloc(_NSButton) checkbox = objc_msgSend_rect(checkbox, _initWithFrame, 0, 0, 100, 100) @@ -173,7 +173,7 @@ func (s *sysData) make(initText string, window *sysData) error { ret := make(chan C.id) defer close(ret) uitask <- func() { - ret <- ct.make(parentWindow) + ret <- ct.make(parentWindow, s.alternate) } s.id = <-ret err := s.setText(initText)