diff options
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) +} |
