summaryrefslogtreecommitdiff
path: root/eventMouse.go
diff options
context:
space:
mode:
Diffstat (limited to 'eventMouse.go')
-rw-r--r--eventMouse.go32
1 files changed, 6 insertions, 26 deletions
diff --git a/eventMouse.go b/eventMouse.go
index eb89978..f3a223d 100644
--- a/eventMouse.go
+++ b/eventMouse.go
@@ -4,7 +4,6 @@
package main
import (
- "errors"
"fmt"
"github.com/awesome-gocui/gocui"
@@ -74,6 +73,11 @@ func mouseDown(g *gocui.Gui, v *gocui.View) error {
tk.doWidgetClick(w, h)
return nil
}
+ if tk.node.WidgetType == widget.Textbox {
+ log.Info("SENDING CLICK TO Textbox")
+ tk.doWidgetClick(w, h)
+ return nil
+ }
found = true
}
@@ -109,37 +113,13 @@ func mouseDown(g *gocui.Gui, v *gocui.View) error {
log.Log(GOCUI, fmt.Sprintf("mouseDown() found nothing at (%d,%d)", mx, my))
}
+ // sort this junk out
vx0, vy0, vx1, vy1, err := g.ViewPosition("msg")
if err == nil {
if mx >= vx0 && mx <= vx1 && my >= vy0 && my <= vy1 {
return msgDown(g, v)
}
}
-
- maxX, _ := g.Size()
-
- // why was this here?
- // findUnderMouse()
-
- // TODO: USE THIS TO MAKE TEMPORARY HELP / INSTRUCTION DIALOGS
-
- // this message will pop up when you click on the magic thing
- // figure out how this works and make it generically useful.
- msg := fmt.Sprintf("This is -222 widget demo. %d,%d", mx, my)
- // dropdownClicked(mx, my)
- x := mx - len(msg)/2
- if x < 0 {
- x = 0
- } else if x+len(msg)+1 > maxX-1 {
- x = maxX - 1 - len(msg) - 1
- }
- log.Log(GOCUI, "mouseDown() about to write out message to 'globalDown' view. msg =", msg)
- if v, err := g.SetView("globalDown", x, my-1, x+len(msg)+1, my+1, 0); err != nil {
- if !errors.Is(err, gocui.ErrUnknownView) {
- return err
- }
- v.WriteString(msg)
- }
return nil
}