summaryrefslogtreecommitdiff
path: root/eventMouseClick.go
diff options
context:
space:
mode:
Diffstat (limited to 'eventMouseClick.go')
-rw-r--r--eventMouseClick.go29
1 files changed, 8 insertions, 21 deletions
diff --git a/eventMouseClick.go b/eventMouseClick.go
index 675aeac..2b725a6 100644
--- a/eventMouseClick.go
+++ b/eventMouseClick.go
@@ -6,7 +6,6 @@ package main
import (
"fmt"
- "github.com/awesome-gocui/gocui"
"go.wit.com/log"
"go.wit.com/widget"
)
@@ -109,18 +108,15 @@ func (tk *guiWidget) doWidgetClick(w int, h int) {
}
}
-// sends the mouse click to a widget underneath
-func clickOLD(g *gocui.Gui, v *gocui.View) error {
- mouseW, mouseH := me.baseGui.MousePosition()
-
- w := mouseW
- h := mouseH
+// handles a mouse click
+func doMouseClick(w int, h int) {
+ dropdownUnclicked(w, h)
// 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
+ return
}
}
@@ -128,7 +124,7 @@ func clickOLD(g *gocui.Gui, v *gocui.View) error {
for _, tk := range findByXY(w, h) {
if tk.node.WidgetType == widget.Button {
tk.doWidgetClick(w, h)
- return nil
+ return
}
}
@@ -140,18 +136,9 @@ func clickOLD(g *gocui.Gui, v *gocui.View) error {
continue
}
tk.doWidgetClick(w, h)
- return nil
+ return
}
- log.Log(GOCUI, "click() nothing was at:", v.Name(), mouseW, mouseH)
- return nil
- /*
- // not sure what SetCurrentView() does right now. it was here before
- // SetCurrentView dies if it's sent an non-existent view
- if _, err := g.SetCurrentView(v.Name()); err != nil {
- log.Log(GOCUI, "click() END v.Name =", v.Name(), "err =", err)
- // return err // return causes gocui.MainLoop() to exit. Do we ever want that to happen here?
- return nil
- }
- */
+ log.Log(GOCUI, "click() nothing was at:", w, h)
+ return
}