summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-01 13:58:53 -0600
committerJeff Carr <[email protected]>2025-02-01 13:58:53 -0600
commit417b3e5225cfdf00d116082832c44ea1aab93664 (patch)
tree4d0e85aea4697c690b4022d6045f99ace73c6002
parente4f0524bdf5331d91c95c9cb89eb4f40138a0ab1 (diff)
use dumpWidget() where possible
-rw-r--r--dropdown.go2
-rw-r--r--eventBindings.go7
-rw-r--r--eventMouse.go11
-rw-r--r--eventMouseClick.go6
4 files changed, 11 insertions, 15 deletions
diff --git a/dropdown.go b/dropdown.go
index 8e34ec4..3eefea3 100644
--- a/dropdown.go
+++ b/dropdown.go
@@ -173,7 +173,7 @@ func dropdownUnclicked(w, h int) {
// examine everything under X & Y on the screen)
for _, tk := range findByXY(w, h) {
- // log.Log(GOCUI, fmt.Sprintf("findByXY() (dropdown) %-8s wId=%4d at (%3d,%3d) %s", tk.WidgetType, tk.node.WidgetId, w, h, tk.node.String()))
+ // tk.dumpWidget("dropdownUnclicked()")
if tk.WidgetType == widget.Dropdown {
d = tk
}
diff --git a/eventBindings.go b/eventBindings.go
index b093718..ca25fde 100644
--- a/eventBindings.go
+++ b/eventBindings.go
@@ -4,7 +4,6 @@
package main
import (
- "fmt"
"syscall"
"github.com/awesome-gocui/gocui"
@@ -68,11 +67,11 @@ func theNotsure(g *gocui.Gui, v *gocui.View) error {
w, h := g.MousePosition()
for _, tk := range findByXY(w, h) {
if tk.WidgetType == widget.Stdout {
- log.Log(GOCUI, fmt.Sprintf("findByXY() '2' key %-8s wId=%4d at (%3d,%3d) %s", tk.WidgetType, tk.node.WidgetId, w, h, tk.node.String()))
+ tk.dumpWidget("theNotsure()")
log.Info("skipping stdout")
continue
}
- log.Log(GOCUI, fmt.Sprintf("findByXY() HIDDING %-8s wId=%4d at (%3d,%3d) %s", tk.WidgetType, tk.node.WidgetId, w, h, tk.node.String()))
+ tk.dumpWidget("theNotsure() HIDDING")
tk.Hide()
}
return nil
@@ -137,7 +136,7 @@ func openDebuggger(g *gocui.Gui, v *gocui.View) error {
func theFind(g *gocui.Gui, v *gocui.View) error {
w, h := g.MousePosition()
for _, tk := range findByXY(w, h) {
- log.Log(GOCUI, fmt.Sprintf("findByXY() 'f' key %-8s wId=%4d at (%3d,%3d) %s", tk.WidgetType, tk.node.WidgetId, w, h, tk.node.String()))
+ tk.dumpWidget("theFind()")
}
return nil
}
diff --git a/eventMouse.go b/eventMouse.go
index 22d153c..383185b 100644
--- a/eventMouse.go
+++ b/eventMouse.go
@@ -35,8 +35,7 @@ func mouseMove(g *gocui.Gui) {
if me.supermouse {
for _, tk := range findByXY(w, h) {
- tk.dumpWidget("findByXY()")
- // log.Log(GOCUI, fmt.Sprintf("findByXY() mouseMove() %s wId=%d cuiName=%s at (%d,%d)", tk.WidgetType, tk.node.WidgetId, tk.cuiName, w, h))
+ tk.dumpWidget("mouseMove()")
}
}
@@ -56,7 +55,7 @@ func msgDown(g *gocui.Gui, v *gocui.View) error {
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))
+ tk.dumpWidget("mouseDown()")
}
// debugging output
@@ -78,7 +77,7 @@ func mouseUp(g *gocui.Gui, v *gocui.View) error {
// 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))
+ tk.dumpWidget("mouseUp()")
}
*/
@@ -109,11 +108,11 @@ func mouseDown(g *gocui.Gui, v *gocui.View) error {
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))
+ tk.dumpWidget("mouseDown()")
found = true
}
if !found {
- log.Log(GOCUI, fmt.Sprintf("findByXY() mouseDown() found nothing at (%d,%d)", mx, my))
+ log.Log(GOCUI, fmt.Sprintf("mouseDown() found nothing at (%d,%d)", mx, my))
}
vx0, vy0, vx1, vy1, err := g.ViewPosition("msg")
diff --git a/eventMouseClick.go b/eventMouseClick.go
index f96c144..d939f7a 100644
--- a/eventMouseClick.go
+++ b/eventMouseClick.go
@@ -4,8 +4,6 @@
package main
import (
- "fmt"
-
"github.com/awesome-gocui/gocui"
"go.wit.com/log"
"go.wit.com/widget"
@@ -85,7 +83,7 @@ func (tk *guiWidget) doWidgetClick(w int, h int) {
tk.showDropdown()
me.dropdownW = tk
default:
- log.Log(GOCUI, fmt.Sprintf("findByXY() blank click() %s wId=%d cuiName=%s at (%d,%d)", tk.WidgetType, tk.node.WidgetId, tk.cuiName, w, h))
+ tk.dumpWidget("blank click()")
}
}
@@ -98,7 +96,7 @@ func click(g *gocui.Gui, v *gocui.View) error {
for _, tk := range findByXY(w, h) {
// will show you everything found on a mouse click. great for debugging!
- // log.Log(GOCUI, fmt.Sprintf("findByXY() click() %s wId=%d cuiName=%s at (%d,%d)", tk.WidgetType, tk.node.WidgetId, tk.cuiName, w, h))
+ // tk.dumpWidget("click()")
if tk.WidgetType == widget.Stdout {
// don't send clicks to the stdout debugging window
continue