diff options
Diffstat (limited to 'redo/checkbox_darwin.go')
| -rw-r--r-- | redo/checkbox_darwin.go | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/redo/checkbox_darwin.go b/redo/checkbox_darwin.go new file mode 100644 index 0000000..ee7e88c --- /dev/null +++ b/redo/checkbox_darwin.go @@ -0,0 +1,27 @@ +// 16 july 2014 + +package ui + +// #include "objc_darwin.h" +import "C" + +type checkbox struct { + *button +} + +func newCheckbox(text string) *checkbox { + return &checkbox{ + button: finishNewButton(C.newCheckbox(), text), + } +} + +// we don't need to define our own event here; we can just reuse Button's +// (it's all target-action anyway) + +func (c *checkbox) Checked() bool { + return fromBOOL(C.checkboxChecked(c.id)) +} + +func (c *checkbox) SetChecked(checked bool) { + C.checkboxSetChecked(c.id, toBOOL(checked)) +} |
