diff options
| author | Pietro Gagliardi <[email protected]> | 2014-07-26 09:20:33 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-07-26 09:20:33 -0400 |
| commit | e8df54cb825e7026a2e6f2fdaa15da1ab06cb607 (patch) | |
| tree | 04fa43804a3a6a3f80c45a1227c3e341e855d19f /redo/controls_darwin.go | |
| parent | 348b3f70327e1bbf35e9db455a5939f7197b17d9 (diff) | |
Implemented TextField on Mac OS X.
Diffstat (limited to 'redo/controls_darwin.go')
| -rw-r--r-- | redo/controls_darwin.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/redo/controls_darwin.go b/redo/controls_darwin.go index 02b2d64..a4e6c29 100644 --- a/redo/controls_darwin.go +++ b/redo/controls_darwin.go @@ -96,3 +96,29 @@ func (c *checkbox) Checked() bool { func (c *checkbox) SetChecked(checked bool) { C.checkboxSetChecked(c.id, toBOOL(checked)) } + +type textField struct { + *widgetbase +} + +func newTextField() *textField { + return &textField{ + widgetbase: newWidget(C.newTextField()), + } +} + +func newPasswordField() *textField { + return &textField{ + widgetbase: newWidget(C.newPasswordField()), + } +} + +func (t *textField) Text() string { + return C.GoString(C.textFieldText(t.id)) +} + +func (t *textField) SetText(text string) { + ctext := C.CString(text) + defer C.free(unsafe.Pointer(ctext)) + C.textFieldSetText(t.id, ctext) +} |
