diff options
| author | Pietro Gagliardi <[email protected]> | 2014-10-18 17:03:38 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-10-18 17:03:38 -0400 |
| commit | aed423a09f35e26a318bd44a6670d4222906de9a (patch) | |
| tree | 01ad31d5c137859dfeae5f42094834b405971177 /newctrl/checkbox_darwin.go | |
| parent | 62048303a34f6cac733798651adb53b640e2114a (diff) | |
Remvoed the newctrl working directory.
Diffstat (limited to 'newctrl/checkbox_darwin.go')
| -rw-r--r-- | newctrl/checkbox_darwin.go | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/newctrl/checkbox_darwin.go b/newctrl/checkbox_darwin.go deleted file mode 100644 index 1578add..0000000 --- a/newctrl/checkbox_darwin.go +++ /dev/null @@ -1,55 +0,0 @@ -// 16 july 2014 - -package ui - -import ( - "unsafe" -) - -// #include "objc_darwin.h" -import "C" - -type checkbox struct { - *controlSingleObject - toggled *event -} - -func newCheckbox(text string) *checkbox { - ctext := C.CString(text) - defer C.free(unsafe.Pointer(ctext)) - c := &checkbox{ - controlSingleObject: newControlSingleObject(C.newCheckbox()), - toggled: newEvent(), - } - C.buttonSetText(c.id, ctext) - C.checkboxSetDelegate(c.id, unsafe.Pointer(c)) - return c -} - -func (c *checkbox) OnToggled(e func()) { - c.toggled.set(e) -} - -func (c *checkbox) Text() string { - return C.GoString(C.buttonText(c.id)) -} - -func (c *checkbox) SetText(text string) { - ctext := C.CString(text) - defer C.free(unsafe.Pointer(ctext)) - C.buttonSetText(c.id, ctext) -} - -func (c *checkbox) Checked() bool { - return fromBOOL(C.checkboxChecked(c.id)) -} - -func (c *checkbox) SetChecked(checked bool) { - C.checkboxSetChecked(c.id, toBOOL(checked)) -} - -//export checkboxToggled -func checkboxToggled(xc unsafe.Pointer) { - c := (*checkbox)(unsafe.Pointer(xc)) - c.toggled.fire() -} |
