diff options
| author | Jeff Carr <[email protected]> | 2025-01-31 11:01:47 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-01-31 13:47:45 -0600 |
| commit | 73de9899a890d3babfebb2427397fb82dcc021c9 (patch) | |
| tree | 7b95ce917e065357d9ff200cb500aff8f0386100 /eventMouse.go | |
| parent | c348940ca1367e9c64560812b12fbde27f7ad17e (diff) | |
hmm. mouse click detection is better. now what?
Diffstat (limited to 'eventMouse.go')
| -rw-r--r-- | eventMouse.go | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/eventMouse.go b/eventMouse.go index 88702c3..a50142a 100644 --- a/eventMouse.go +++ b/eventMouse.go @@ -37,11 +37,19 @@ func mouseMove(g *gocui.Gui) { } } +// I think this lets me drag the debugging window func msgDown(g *gocui.Gui, v *gocui.View) error { initialMouseX, initialMouseY = g.MousePosition() + w := initialMouseX + h := initialMouseY + + for _, tk := range findByXY(w, h) { + log.Log(GOCUI, fmt.Sprintf("findByXY() msgDown() %s wId=%d cuiName=%s at (%d,%d)", tk.WidgetType, tk.node.WidgetId, tk.cuiName, w, h)) + } + // debugging output - log.Log(GOCUI, "msgDown() X,Y", initialMouseX, initialMouseY) + // log.Log(GOCUI, "msgDown() X,Y", initialMouseX, initialMouseY) // vx, vy, _, _, err := g.ViewPosition("msg") @@ -56,6 +64,10 @@ func msgDown(g *gocui.Gui, v *gocui.View) error { func mouseUp(g *gocui.Gui, v *gocui.View) error { w, h := g.MousePosition() + 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) if msgMouseDown { @@ -81,6 +93,11 @@ 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() + } + vx0, vy0, vx1, vy1, err := g.ViewPosition("msg") if err == nil { if mx >= vx0 && mx <= vx1 && my >= vy0 && my <= vy1 { |
