summaryrefslogtreecommitdiff
path: root/eventMouseClick.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-01 15:48:28 -0600
committerJeff Carr <[email protected]>2025-02-01 15:48:28 -0600
commit49f8e1c043ed5dfe39d0c56a9fd52b20fb069bb2 (patch)
treecf8dc6f2f6f853e4ed90b64ab9f9cc6eadfb1bb1 /eventMouseClick.go
parent4bc9fa41b77090264716670635e3155a8def7ff6 (diff)
dropdown menu selects and changes text again
Diffstat (limited to 'eventMouseClick.go')
-rw-r--r--eventMouseClick.go15
1 files changed, 12 insertions, 3 deletions
diff --git a/eventMouseClick.go b/eventMouseClick.go
index a292cc4..c3c960e 100644
--- a/eventMouseClick.go
+++ b/eventMouseClick.go
@@ -82,12 +82,13 @@ func (tk *guiWidget) doWidgetClick(w int, h int) {
log.Log(GOCUI, "do the dropdown here")
tk.showDropdown()
me.dropdownW = tk
- case widget.Flag:
- log.Log(GOCUI, "flag widget found!")
- tk.dumpWidget("flag click")
case widget.Stdout:
log.Log(GOCUI, "stdout widget found!")
tk.dumpWidget("stdout click")
+ case widget.Flag:
+ log.Log(GOCUI, "flag widget found!")
+ got := tk.dropdownClicked(w, h)
+ log.Log(GOCUI, "flag click got", got)
default:
tk.dumpWidget("blank click()")
}
@@ -100,6 +101,14 @@ func click(g *gocui.Gui, v *gocui.View) error {
w := mouseW
h := mouseH
+ // Flag widgets (dropdown menus, etc) are the highest priority. ALWAYS SEND MOUSE CLICKS THERE FIRST
+ for _, tk := range findByXY(w, h) {
+ if tk.node.WidgetType == widget.Flag {
+ tk.doWidgetClick(w, h)
+ return nil
+ }
+ }
+
for _, tk := range findByXY(w, h) {
// will show you everything found on a mouse click. great for debugging!
// tk.dumpWidget("click()")