summaryrefslogtreecommitdiff
path: root/eventMouse.go
diff options
context:
space:
mode:
Diffstat (limited to 'eventMouse.go')
-rw-r--r--eventMouse.go19
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 {