summaryrefslogtreecommitdiff
path: root/eventMouse.go
diff options
context:
space:
mode:
Diffstat (limited to 'eventMouse.go')
-rw-r--r--eventMouse.go18
1 files changed, 10 insertions, 8 deletions
diff --git a/eventMouse.go b/eventMouse.go
index 3735010..9821bd1 100644
--- a/eventMouse.go
+++ b/eventMouse.go
@@ -65,11 +65,9 @@ func mouseUp(g *gocui.Gui, v *gocui.View) error {
w, h := g.MousePosition()
// useful to debug everything that is being clicked on
- /*
- for _, tk := range findByXY(w, h) {
- log.Log(GOCUI, fmt.Sprintf("findByXY() mouseUp() %s wId=%d cuiName=%s at (%d,%d)", tk.WidgetType, tk.node.WidgetId, tk.cuiName, w, h))
- }
- */
+ for _, tk := range findByXY(w, h) {
+ log.Log(GOCUI, fmt.Sprintf("findByXY() mouseUp() %s wId=%d cuiName=%s at (%d,%d)", tk.WidgetType, tk.node.WidgetId, tk.cuiName, w, h))
+ }
dropdownUnclicked(w, h)
@@ -96,9 +94,13 @@ func mouseUp(g *gocui.Gui, v *gocui.View) error {
func mouseDown(g *gocui.Gui, v *gocui.View) error {
mx, my := g.MousePosition()
- for _, w := range findByXY(mx, my) {
- log.Log(GOCUI, fmt.Sprintf("findByXY() mouseDown() %s wId=%d cuiName=%s at (%d,%d)", w.WidgetType, w.node.WidgetId, w.cuiName, mx, my))
- // w.doWidgetClick()
+ var found bool = false
+ for _, tk := range findByXY(mx, my) {
+ log.Log(GOCUI, fmt.Sprintf("findByXY() mouseDown() %s wId=%d cuiName=%s at (%d,%d)", tk.WidgetType, tk.node.WidgetId, tk.cuiName, mx, my))
+ found = true
+ }
+ if !found {
+ log.Log(GOCUI, fmt.Sprintf("findByXY() mouseDown() found nothing at (%d,%d)", mx, my))
}
vx0, vy0, vx1, vy1, err := g.ViewPosition("msg")