summaryrefslogtreecommitdiff
path: root/redo/basicctrls_darwin.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-07-30 12:34:54 -0400
committerPietro Gagliardi <[email protected]>2014-07-30 12:34:54 -0400
commitc0473db73c11927144f79bb69d01a290753b5de0 (patch)
tree4e56aacdf5aa9129f77ebd47553a4cecb6207748 /redo/basicctrls_darwin.go
parent4740f72efb09042abc3b0577044e720bcc36dcb2 (diff)
Ported the new Control setup to Mac OS X.
Diffstat (limited to 'redo/basicctrls_darwin.go')
-rw-r--r--redo/basicctrls_darwin.go37
1 files changed, 4 insertions, 33 deletions
diff --git a/redo/basicctrls_darwin.go b/redo/basicctrls_darwin.go
index 78e9138..1899133 100644
--- a/redo/basicctrls_darwin.go
+++ b/redo/basicctrls_darwin.go
@@ -9,37 +9,8 @@ import (
// #include "objc_darwin.h"
import "C"
-type widgetbase struct {
- id C.id
-}
-
-func newWidget(id C.id) *widgetbase {
- return &widgetbase{
- id: id,
- }
-}
-
-// these few methods are embedded by all the various Controls since they all will do the same thing
-
-type controlParent struct {
- id C.id
-}
-
-func (w *widgetbase) setParent(parent *controlParent) {
- // redrawing the new window handled by C.parent()
- C.parent(w.id, parent.id)
-}
-
-func (w *widgetbase) containerShow() {
- C.controlSetHidden(w.id, C.NO)
-}
-
-func (w *widgetbase) containerHide() {
- C.controlSetHidden(w.id, C.YES)
-}
-
type button struct {
- *widgetbase
+ *controlbase
clicked *event
}
@@ -47,7 +18,7 @@ func finishNewButton(id C.id, text string) *button {
ctext := C.CString(text)
defer C.free(unsafe.Pointer(ctext))
b := &button{
- widgetbase: newWidget(id),
+ controlbase: newControl(id),
clicked: newEvent(),
}
C.buttonSetText(b.id, ctext)
@@ -102,12 +73,12 @@ func (c *checkbox) SetChecked(checked bool) {
}
type textField struct {
- *widgetbase
+ *controlbase
}
func finishNewTextField(id C.id) *textField {
return &textField{
- widgetbase: newWidget(id),
+ controlbase: newControl(id),
}
}