summaryrefslogtreecommitdiff
path: root/eventMouseClick.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-09 06:14:57 -0600
committerJeff Carr <[email protected]>2025-02-09 06:14:57 -0600
commit36745e0492d52bf337f5e6db1ab52912511ec010 (patch)
tree60002778f640e2acafcf4e4e3d3fe8075a7a0c6b /eventMouseClick.go
parent9540c01d8320fb729ad4c127d76ff18ca0cd4d0c (diff)
button disable maybe works?
Diffstat (limited to 'eventMouseClick.go')
-rw-r--r--eventMouseClick.go16
1 files changed, 11 insertions, 5 deletions
diff --git a/eventMouseClick.go b/eventMouseClick.go
index eda0a26..ce0b6a6 100644
--- a/eventMouseClick.go
+++ b/eventMouseClick.go
@@ -10,6 +10,15 @@ import (
"go.wit.com/widget"
)
+func (tk *guiWidget) doButtonClick() {
+ if tk.node.IsEnabled() {
+ tk.dumpWidget("click()") // enable this to debug widget clicks
+ me.myTree.SendFromUser(tk.node)
+ } else {
+ tk.dumpWidget("disabled()") // enable this to debug widget clicks
+ }
+}
+
// this whole things was impossible to make but it got me where I am now
// the debugging is way way better now with it being visible in the Stdout window
// so now it's possible to redo all this and make it better
@@ -28,9 +37,7 @@ func (tk *guiWidget) doWidgetClick(w int, h int) {
}
me.myTree.SendUserEvent(tk.node)
case widget.Button:
- // if tk.node.Enabled() {
- me.myTree.SendFromUser(tk.node)
- // }
+ tk.doButtonClick()
case widget.Combobox:
tk.showDropdown()
case widget.Dropdown:
@@ -87,8 +94,7 @@ func doMouseClick(w int, h int) {
me.myTree.SendUserEvent(tk.node)
return
case widget.Button:
- tk.dumpWidget("click()") // enable this to debug widget clicks
- me.myTree.SendFromUser(tk.node)
+ tk.doButtonClick()
return
case widget.Combobox:
tk.showDropdown()