no output except 'mouse drag()'

This commit is contained in:
Jeff Carr 2025-02-06 14:19:43 -06:00
parent 5675307497
commit 1918dcbbde
2 changed files with 3 additions and 5 deletions

View File

@ -76,13 +76,13 @@ func (tk *guiWidget) dumpWidget(s string) {
} }
var end string var end string
if tk.node.WidgetType == widget.Box { if tk.node.WidgetType == widget.Box {
end = fmt.Sprintf("%5s %-8s %s", tk.cuiName, tk.node.WidgetType, tk.node.State.Direction.String()) end = fmt.Sprintf("%-8s %-8s %s", tk.node.WidgetType, tk.cuiName, tk.node.State.Direction.String())
} else { } else {
curval := tk.String() curval := tk.String()
if curval == "" { if curval == "" {
curval = tk.node.GetLabel() curval = tk.node.GetLabel()
} }
end = fmt.Sprintf("%5s %-8s %s", tk.cuiName, tk.node.WidgetType, tk.String()) end = fmt.Sprintf("%-8s %-8s %s", tk.node.WidgetType, tk.cuiName, tk.String())
} }
log.Log(GOCUI, s1, s, end) log.Log(GOCUI, s1, s, end)
} }

View File

@ -20,7 +20,6 @@ func mouseUp(g *gocui.Gui, v *gocui.View) error {
} }
*/ */
log.Info("mouseUp() setting me.globalMouseDown = false")
me.globalMouseDown = false me.globalMouseDown = false
me.currentDrag = nil me.currentDrag = nil
@ -33,7 +32,6 @@ func mouseUp(g *gocui.Gui, v *gocui.View) error {
// widget was underneath so you can active // widget was underneath so you can active
// the right response for the toolkit user's app // the right response for the toolkit user's app
func mouseDown(g *gocui.Gui, v *gocui.View) error { func mouseDown(g *gocui.Gui, v *gocui.View) error {
log.Info("mouseDown() setting globalMouseDown = true")
me.globalMouseDown = true me.globalMouseDown = true
w, h := g.MousePosition() w, h := g.MousePosition()
@ -90,7 +88,7 @@ func mouseDown(g *gocui.Gui, v *gocui.View) error {
} }
} }
} }
tk.dumpWidget("mouseDown() drag") tk.dumpWidget("mouse drag()")
me.currentDrag = tk me.currentDrag = tk
tk.dragW = w - tk.gocuiSize.w0 tk.dragW = w - tk.gocuiSize.w0
tk.dragH = h - tk.gocuiSize.h0 tk.dragH = h - tk.gocuiSize.h0