diff options
| author | Pietro Gagliardi <[email protected]> | 2014-11-05 13:35:39 -0500 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-11-05 13:35:39 -0500 |
| commit | b632fef3b13dc082acbbbd8aaf6898c663da1c0b (patch) | |
| tree | db74e1e02e91e555b50e9ad6efd2eaafafae907f /textfield_darwin.go | |
| parent | cd96f8ee2e0a4ae3370a57357f9bcde4e2a8c36f (diff) | |
Implemented TextField.ReadOnly() on Mac OS X. Began standardizing window class name access on Windows.
Diffstat (limited to 'textfield_darwin.go')
| -rw-r--r-- | textfield_darwin.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/textfield_darwin.go b/textfield_darwin.go index bf63073..c61a1b9 100644 --- a/textfield_darwin.go +++ b/textfield_darwin.go @@ -62,6 +62,16 @@ func (t *textfield) Invalid(reason string) { t.invalid = C.textfieldOpenInvalidPopover(t.id, creason) } +// note that the property here is editable, which is the opposite of read-only + +func (t *textfield) ReadOnly() bool { + return !fromBOOL(C.textfieldEditable(t.id)) +} + +func (t *textfield) SetReadOnly(readonly bool) { + C.textfieldSetEditable(t.id, toBOOL(!readonly)) +} + //export textfieldChanged func textfieldChanged(data unsafe.Pointer) { t := (*textfield)(data) |
