diff options
| author | Pietro Gagliardi <[email protected]> | 2014-03-02 09:17:42 -0500 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-03-02 09:17:42 -0500 |
| commit | 5f6a4ee69024ac727a990f52b93f642d5178dae5 (patch) | |
| tree | 64bd5aa2515e4b15d84efe38f608d5fdc64e38a1 /sysdata_darwin.go | |
| parent | 3e44abc1b862d778c5b0ae01c353fd2c713ca359 (diff) | |
Added Mac OS X Checkboxes.
Diffstat (limited to 'sysdata_darwin.go')
| -rw-r--r-- | sysdata_darwin.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sysdata_darwin.go b/sysdata_darwin.go index 1b99dce..407927c 100644 --- a/sysdata_darwin.go +++ b/sysdata_darwin.go @@ -48,6 +48,7 @@ var ( _setAction = sel_getUid("setAction:") _contentView = sel_getUid("contentView") _addSubview = sel_getUid("addSubview:") + _setButtonType = sel_getUid("setButtonType:") ) func controlShow(what C.id) { @@ -109,6 +110,19 @@ var classTypes = [nctypes]*classData{ textsel: _title, }, c_checkbox: &classData{ + make: func(parentWindow C.id) C.id { + checkbox := objc_alloc(_NSButton) + checkbox = objc_msgSend_rect(checkbox, _initWithFrame, + 0, 0, 100, 100) + objc_msgSend_uint(checkbox, _setButtonType, 3) // NSSwitchButton + windowView := C.objc_msgSend_noargs(parentWindow, _contentView) + C.objc_msgSend_id(windowView, _addSubview, checkbox) + return checkbox + }, + show: controlShow, + hide: controlHide, + settextsel: _setTitle, + textsel: _title, }, c_combobox: &classData{ }, |
