aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2024-11-13 10:28:04 +0100
committerPřemysl Eric Janouch <p@janouch.name>2024-11-13 10:29:11 +0100
commit9c9776bacd19ce27948a21dd449f78e8965f58e2 (patch)
tree5c7493ee16a26c51cffbd31d671e9baed99890ce
parent086b879ab8d488f4355427864214556812b3a712 (diff)
downloadxK-9c9776bacd19ce27948a21dd449f78e8965f58e2.tar.gz
xK-9c9776bacd19ce27948a21dd449f78e8965f58e2.tar.xz
xK-9c9776bacd19ce27948a21dd449f78e8965f58e2.zip
xA: make the log effectively read-only
-rw-r--r--xA/xA.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/xA/xA.go b/xA/xA.go
index cb6ede9..5bd3975 100644
--- a/xA/xA.go
+++ b/xA/xA.go
@@ -1322,7 +1322,8 @@ func (e *inputEntry) SetText(text string) {
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
type logEntry struct {
- // XXX: Sadly, we can't seem to make it read-only in any way.
+ // XXX: Sadly, we can't seem to make it actually read-only.
+ // https://github.com/fyne-io/fyne/issues/5263
widget.Entry
}
@@ -1334,6 +1335,12 @@ func newLogEntry() *logEntry {
return e
}
+func (e *logEntry) SetText(text string) {
+ e.OnChanged = nil
+ e.Entry.SetText(text)
+ e.OnChanged = func(string) { e.Entry.SetText(text) }
+}
+
func (e *logEntry) AcceptsTab() bool {
return false
}