diff options
| author | Pietro Gagliardi <[email protected]> | 2014-06-26 21:54:14 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-06-26 21:54:14 -0400 |
| commit | 20821c26eb32b4f5772cf3e2ba13d36d424731c3 (patch) | |
| tree | be0e5f8df602f064a9a0633b10dec9fe437ec075 /sysdata_darwin.m | |
| parent | ebbd76716f3e35bdb86a6ca9b327bc014d7f6e3b (diff) | |
Implemented Checkbox.SetChecked() on Mac OS X and updated the README.
Diffstat (limited to 'sysdata_darwin.m')
| -rw-r--r-- | sysdata_darwin.m | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sysdata_darwin.m b/sysdata_darwin.m index 1119255..fc1f270 100644 --- a/sysdata_darwin.m +++ b/sysdata_darwin.m @@ -228,3 +228,13 @@ void center(id w) { [toNSWindow(w) center]; } + +void setCheckboxChecked(id checkbox, BOOL check) +{ + // -[NSButton setState:] takes a NSInteger but the state constants are NSCellStateValue which is NSUInteger (despite NSMixedState being -1); let's play it safe here + if (check) { + [toNSButton(checkbox) setState:NSOnState]; + return; + } + [toNSButton(checkbox) setState:NSOffState]; +} |
