summaryrefslogtreecommitdiff
path: root/eventMouse.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-01-31 13:00:26 -0600
committerJeff Carr <[email protected]>2025-01-31 13:47:45 -0600
commitb7cd6d07fcaa69d009b3f33f7c59afb16b719029 (patch)
tree5acb4a3b04dd7603a6085a5be51b448227512a11 /eventMouse.go
parentf76960c90764159d1cad6b5264687accc39ca4bd (diff)
hmm. can't figure out where clicks are goingv0.22.15
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")