diff options
| author | Pietro Gagliardi <[email protected]> | 2014-10-18 17:03:07 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-10-18 17:03:07 -0400 |
| commit | 62048303a34f6cac733798651adb53b640e2114a (patch) | |
| tree | b03994dfe1d5cfbc94be65075f3345a45166bbef /button_darwin.go | |
| parent | 8c8b642adbed274133b6e9d975c7ca8786300d2c (diff) | |
Merged new container/sizing stuff.
Diffstat (limited to 'button_darwin.go')
| -rw-r--r-- | button_darwin.go | 36 |
1 files changed, 6 insertions, 30 deletions
diff --git a/button_darwin.go b/button_darwin.go index 06fac20..1a0cd1b 100644 --- a/button_darwin.go +++ b/button_darwin.go @@ -10,7 +10,7 @@ import ( import "C" type button struct { - _id C.id + *controlSingleObject clicked *event } @@ -18,11 +18,11 @@ func newButton(text string) *button { ctext := C.CString(text) defer C.free(unsafe.Pointer(ctext)) b := &button{ - _id: C.newButton(), + controlSingleObject: newControlSingleObject(C.newButton()), clicked: newEvent(), } - C.buttonSetText(b._id, ctext) - C.buttonSetDelegate(b._id, unsafe.Pointer(b)) + C.buttonSetText(b.id, ctext) + C.buttonSetDelegate(b.id, unsafe.Pointer(b)) return b } @@ -31,13 +31,13 @@ func (b *button) OnClicked(e func()) { } func (b *button) Text() string { - return C.GoString(C.buttonText(b._id)) + 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) + C.buttonSetText(b.id, ctext) } //export buttonClicked @@ -45,27 +45,3 @@ func buttonClicked(xb unsafe.Pointer) { b := (*button)(unsafe.Pointer(xb)) b.clicked.fire() } - -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) -} |
