summaryrefslogtreecommitdiff
path: root/textfield_windows.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-11-05 12:59:44 -0500
committerPietro Gagliardi <[email protected]>2014-11-05 12:59:44 -0500
commit5fc368fc23f0720fc193883d0709df8417268987 (patch)
treebd929349e56551dbca795300457232093d6047b3 /textfield_windows.go
parent0bd58006a6001f830413bb4dcbb7bcad6aea3cc9 (diff)
Started adding TextField.ReadOnly() and implemented it (mostly) on Windows.
Diffstat (limited to 'textfield_windows.go')
-rw-r--r--textfield_windows.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/textfield_windows.go b/textfield_windows.go
index 1d2025b..a78a12f 100644
--- a/textfield_windows.go
+++ b/textfield_windows.go
@@ -58,6 +58,18 @@ func (t *textfield) Invalid(reason string) {
C.textfieldSetAndShowInvalidBalloonTip(t.hwnd, toUTF16(reason))
}
+func (t *textfield) ReadOnly() bool {
+ return C.textfieldReadOnly(t.hwnd) != 0
+}
+
+func (t *textfield) SetReadOnly(readonly bool) {
+ if readonly {
+ C.textfieldSetReadOnly(t.hwnd, C.TRUE)
+ return
+ }
+ C.textfieldSetReadOnly(t.hwnd, C.FALSE)
+}
+
//export textfieldChanged
func textfieldChanged(data unsafe.Pointer) {
t := (*textfield)(data)