summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-04-03 16:32:01 -0500
committerJeff Carr <[email protected]>2023-04-03 16:32:01 -0500
commitefe4d11576c0dbb0b1e4189274f9908c3eb7e7c3 (patch)
tree1c83b7f1d3312ea97577c77f9f2b2bd5a4a9e072
parentc14ba9d6da0a82d6cd39645764a8f9b1a88af5d4 (diff)
gocui: more size debugging
Signed-off-by: Jeff Carr <[email protected]>
-rw-r--r--slider.go5
-rw-r--r--spinner.go5
-rw-r--r--textbox.go5
-rw-r--r--toolkit/gocui/click.go4
-rw-r--r--toolkit/gocui/debug.go4
5 files changed, 10 insertions, 13 deletions
diff --git a/slider.go b/slider.go
index 1d2d23d..129930d 100644
--- a/slider.go
+++ b/slider.go
@@ -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
diff --git a/spinner.go b/spinner.go
index 0f48e8f..4b0b3aa 100644
--- a/spinner.go
+++ b/spinner.go
@@ -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
diff --git a/textbox.go b/textbox.go
index 75703a2..f8208b9 100644
--- a/textbox.go
+++ b/textbox.go
@@ -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),