summaryrefslogtreecommitdiff
path: root/eventMouseClick.go
diff options
context:
space:
mode:
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()")