From b632fef3b13dc082acbbbd8aaf6898c663da1c0b Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Wed, 5 Nov 2014 13:35:39 -0500 Subject: Implemented TextField.ReadOnly() on Mac OS X. Began standardizing window class name access on Windows. --- textfield_darwin.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'textfield_darwin.go') 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) -- cgit v1.2.3