From d018953d7ef1b276cc3229e04ba6fc75018c888a Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sat, 2 Aug 2014 22:35:58 -0400 Subject: 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. --- redo/checkbox_darwin.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 redo/checkbox_darwin.go (limited to 'redo/checkbox_darwin.go') 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)) +} -- cgit v1.2.3