summaryrefslogtreecommitdiff
path: root/eventMouse.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-01 18:27:42 -0600
committerJeff Carr <[email protected]>2025-02-01 18:27:42 -0600
commit0355f7c2fb4d94e01ded040be58180e0d0d1e60b (patch)
tree1c23380a7d0b3fc22b308bccc9c2ffe5cab32335 /eventMouse.go
parentf79cf8917058b421a4f8dd4a854795720671c008 (diff)
huh. getting somewhere
Diffstat (limited to 'eventMouse.go')
-rw-r--r--eventMouse.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/eventMouse.go b/eventMouse.go
index 63e0165..881ad6a 100644
--- a/eventMouse.go
+++ b/eventMouse.go
@@ -10,6 +10,7 @@ import (
"github.com/awesome-gocui/gocui"
"go.wit.com/log"
+ "go.wit.com/widget"
)
// event triggers when you push down on a mouse button
@@ -20,15 +21,16 @@ func msgDown(g *gocui.Gui, v *gocui.View) error {
h := initialMouseY
for _, tk := range findByXY(w, h) {
- tk.dumpWidget("mouseDown()")
+ tk.dumpWidget("msgDown()")
}
vx, vy, _, _, err := g.ViewPosition("msg")
if err == nil {
xOffset = initialMouseX - vx
yOffset = initialMouseY - vy
- msgMouseDown = true
}
+ log.Info("setting mousedown to true")
+ msgMouseDown = true
return nil
}
@@ -45,6 +47,7 @@ func mouseUp(g *gocui.Gui, v *gocui.View) error {
dropdownUnclicked(w, h)
if msgMouseDown {
+ log.Info("setting mousedown to false")
msgMouseDown = false
} else if globalMouseDown {
globalMouseDown = false
@@ -62,6 +65,11 @@ func mouseDown(g *gocui.Gui, v *gocui.View) error {
var found bool = false
for _, tk := range findByXY(mx, my) {
tk.dumpWidget("mouseDown()")
+ if tk.node.WidgetType == widget.Window {
+ log.Info("SENDING CLICK TO WINDOW")
+ tk.doWidgetClick(mx, my)
+ return nil
+ }
found = true
}
if !found {