summaryrefslogtreecommitdiff
path: root/redo/button_darwin.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-08-30 23:02:02 -0400
committerPietro Gagliardi <[email protected]>2014-08-30 23:02:02 -0400
commit77bf566ebbcb62acd4d08d905d9542d6ff9b6b80 (patch)
treeeeb8e72bc3bf57f5be7f0c0af4319189ac6de838 /redo/button_darwin.go
parent155899c65ed32245e2ccad4197a10c77017d835b (diff)
...in with the new.
Diffstat (limited to 'redo/button_darwin.go')
-rw-r--r--redo/button_darwin.go72
1 files changed, 0 insertions, 72 deletions
diff --git a/redo/button_darwin.go b/redo/button_darwin.go
deleted file mode 100644
index 9444da4..0000000
--- a/redo/button_darwin.go
+++ /dev/null
@@ -1,72 +0,0 @@
-// 16 july 2014
-
-package ui
-
-import (
- "unsafe"
-)
-
-// #include "objc_darwin.h"
-import "C"
-
-type button struct {
- _id C.id
- clicked *event
-}
-
-func newButton(text string) *button {
- ctext := C.CString(text)
- defer C.free(unsafe.Pointer(ctext))
- b := &button{
- _id: C.newButton(),
- clicked: newEvent(),
- }
- C.buttonSetText(b._id, ctext)
- C.buttonSetDelegate(b._id, unsafe.Pointer(b))
- return b
-}
-
-func (b *button) OnClicked(e func()) {
- b.clicked.set(e)
-}
-
-func (b *button) Text() string {
- return C.GoString(C.buttonText(b._id))
-}
-
-func (b *button) SetText(text string) {
- ctext := C.CString(text)
- defer C.free(unsafe.Pointer(ctext))
- C.buttonSetText(b._id, ctext)
-}
-
-//export buttonClicked
-func buttonClicked(xb unsafe.Pointer) {
- b := (*button)(unsafe.Pointer(xb))
- b.clicked.fire()
- println("button clicked")
-}
-
-func (b *button) id() C.id {
- return b._id
-}
-
-func (b *button) setParent(p *controlParent) {
- basesetParent(b, p)
-}
-
-func (b *button) allocate(x int, y int, width int, height int, d *sizing) []*allocation {
- return baseallocate(b, x, y, width, height, d)
-}
-
-func (b *button) preferredSize(d *sizing) (width, height int) {
- return basepreferredSize(b, d)
-}
-
-func (b *button) commitResize(a *allocation, d *sizing) {
- basecommitResize(b, a, d)
-}
-
-func (b *button) getAuxResizeInfo(d *sizing) {
- basegetAuxResizeInfo(b, d)
-}