summaryrefslogtreecommitdiff
path: root/redo/checkbox_darwin.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-08-02 22:35:58 -0400
committerPietro Gagliardi <[email protected]>2014-08-02 22:35:58 -0400
commitd018953d7ef1b276cc3229e04ba6fc75018c888a (patch)
tree3f980a017ca498bf499ff9c5e6a53210606b12f9 /redo/checkbox_darwin.go
parent1f6bcde3d9ddcab921f2f4347148f6784ca36a14 (diff)
Split all the Control implementations into their own files and renamed the containerctrls implementation files to say tab instead as they only hold Tab. This is the first part of what should hopefully be the final restructuring.
Diffstat (limited to 'redo/checkbox_darwin.go')
-rw-r--r--redo/checkbox_darwin.go27
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))
+}