diff options
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]; +} |
