diff options
| author | Pietro Gagliardi <[email protected]> | 2015-04-09 13:01:23 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2015-04-09 13:01:23 -0400 |
| commit | 6d93fce5b5eb26b78d003fc79cd0592f697d75e3 (patch) | |
| tree | caa9e4cce02f2187f5c09fd3af39ada77ace5cf2 /new/checkbox_darwin.m | |
| parent | ca607f8fb7c11769c10b8ce787784c91686b629b (diff) | |
Implemented uiCheckbox(Set)Checked() on Mac OS X.
Diffstat (limited to 'new/checkbox_darwin.m')
| -rw-r--r-- | new/checkbox_darwin.m | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/new/checkbox_darwin.m b/new/checkbox_darwin.m index a1fd61c..a07a4d0 100644 --- a/new/checkbox_darwin.m +++ b/new/checkbox_darwin.m @@ -76,3 +76,23 @@ void uiCheckboxOnToggled(uiControl *c, void (*f)(uiControl *, void *), void *dat cc.uiOnToggled = f; cc.uiOnToggledData = data; } + +int uiCheckboxChecked(uiControl *c) +{ + uiCheckboxNSButton *cc; + + cc = (uiCheckboxNSButton *) uiControlHandle(c); + return [cc state] == NSOnState; +} + +void uiCheckboxSetChecked(uiControl *c, int checked) +{ + uiCheckboxNSButton *cc; + NSInteger state; + + cc = (uiCheckboxNSButton *) uiControlHandle(c); + state = NSOnState; + if (!checked) + state = NSOffState; + [cc setState:state]; +} |
