diff options
| author | Jeff Carr <[email protected]> | 2023-04-03 16:32:01 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2023-04-03 16:32:01 -0500 |
| commit | efe4d11576c0dbb0b1e4189274f9908c3eb7e7c3 (patch) | |
| tree | 1c83b7f1d3312ea97577c77f9f2b2bd5a4a9e072 | |
| parent | c14ba9d6da0a82d6cd39645764a8f9b1a88af5d4 (diff) | |
gocui: more size debugging
Signed-off-by: Jeff Carr <[email protected]>
| -rw-r--r-- | slider.go | 5 | ||||
| -rw-r--r-- | spinner.go | 5 | ||||
| -rw-r--r-- | textbox.go | 5 | ||||
| -rw-r--r-- | toolkit/gocui/click.go | 4 | ||||
| -rw-r--r-- | toolkit/gocui/debug.go | 4 |
5 files changed, 10 insertions, 13 deletions
@@ -13,9 +13,8 @@ func (n *Node) NewSlider(name string, x int, y int) *Node { a.ActionType = toolkit.Add a.X = x a.Y = y - // a.Widget = &newNode.widget - // a.Where = &n.widget - // action(&a) + a.Name = name + a.Text = name newaction(&a, newNode, n) return newNode @@ -13,9 +13,8 @@ func (n *Node) NewSpinner(name string, x int, y int) *Node { a.ActionType = toolkit.Add a.X = x a.Y = y - // a.Widget = &newNode.widget - // a.Where = &n.widget - // action(&a) + a.Name = name + a.Text = name newaction(&a, newNode, n) return newNode @@ -11,9 +11,8 @@ func (n *Node) NewTextbox(name string) *Node { var a toolkit.Action a.ActionType = toolkit.Add - // a.Widget = &newNode.widget - // a.Where = &n.widget - // action(&a) + a.Name = name + a.Text = name newaction(&a, newNode, n) return newNode diff --git a/toolkit/gocui/click.go b/toolkit/gocui/click.go index 8e9f2f7..e32825a 100644 --- a/toolkit/gocui/click.go +++ b/toolkit/gocui/click.go @@ -125,7 +125,8 @@ func ctrlDown(g *gocui.Gui, v *gocui.View) error { // find buttons that are below where the mouse button click f = func(widget *cuiWidget) { // if ((widget.logicalSize.w0 < w) && (w < widget.logicalSize.w1)) { - if ((widget.realSize.w0 < w) && (w < widget.realSize.w1)) { + if ((widget.realSize.w0 < w) && (w < widget.realSize.w1) && + (widget.realSize.h0 < h) && (h < widget.realSize.h1)) { widgets = append(widgets, widget) found = widget } @@ -151,6 +152,7 @@ func ctrlDown(g *gocui.Gui, v *gocui.View) error { if (found == nil) { found = me.rootNode } + found.updateLogicalSizes() me.ctrlDown.realSize.w0 = found.logicalSize.w0 me.ctrlDown.realSize.w1 = found.logicalSize.w1 me.ctrlDown.realSize.h0 = found.logicalSize.h0 diff --git a/toolkit/gocui/debug.go b/toolkit/gocui/debug.go index e79b1be..0573f70 100644 --- a/toolkit/gocui/debug.go +++ b/toolkit/gocui/debug.go @@ -42,9 +42,7 @@ func (w *cuiWidget) showWidgetPlacement(b bool, s string) { return } if (w.parent == nil) { - log(logError, "showWidgetPlacement() WTF parent == nil", w.id, w.cuiName) - log(logError, "showWidgetPlacement() WTF parent == nil", w.id, w.cuiName) - log(logError, "showWidgetPlacement() WTF parent == nil", w.id, w.cuiName) + log(logError, "showWidgetPlacement() ERROR parent == nil", w.id, w.cuiName) } log(b, "dump()", s, fmt.Sprintf("(wId,pId)=(%3d,%3d)", w.id, w.parent.id), |
