summaryrefslogtreecommitdiff
path: root/init.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-09 05:17:29 -0600
committerJeff Carr <[email protected]>2025-02-09 05:17:29 -0600
commiteb3b60abb6ccf8fb2731061bc856b3960d698683 (patch)
treea5cabce3364d4033413baaea8e56c92f79885dda /init.go
parent7260d0e8b275dba11aef0cba5048a435516c2b1e (diff)
block events for disable widgets
Diffstat (limited to 'init.go')
-rw-r--r--init.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/init.go b/init.go
index 3883fa1..72b577d 100644
--- a/init.go
+++ b/init.go
@@ -223,6 +223,11 @@ func watchCallback() {
func (n *Node) gotUserEvent(a widget.Action) {
log.Log(CHANGE, "gotUserEvent() received event node =", n.id, n.progname, a.Value)
+ if !n.IsEnabled() {
+ log.Log(WARN, "ignoring plugin event for a disabled widget", n.id, n.progname, a.Value)
+ return
+ }
+
switch n.WidgetType {
case widget.Dropdown:
// n.checked = a.State.Checked // TODO: do this and/or time to switch to protobuf