From ea544e429e1afbb60e91d2cba6caf85d8e08cc64 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sat, 8 Feb 2025 14:43:38 -0600 Subject: [PATCH] setting the size of the textbox correctly --- debug.go | 8 +++++++- dropdown.go | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/debug.go b/debug.go index e820c07..7aeaa33 100644 --- a/debug.go +++ b/debug.go @@ -5,6 +5,7 @@ package main import ( "fmt" + "strings" "github.com/awesome-gocui/gocui" "go.wit.com/log" @@ -87,8 +88,13 @@ func (tk *guiWidget) dumpWidget(s string) { curval := tk.String() if curval == "" { curval = tk.node.GetLabel() + curval = strings.TrimSpace(curval) } - end = fmt.Sprintf("%-8s %-8s %s", tk.node.WidgetType, tk.cuiName, tk.String()) + if curval == "" { + curval = tk.labelN + curval = strings.TrimSpace(curval) + } + end = fmt.Sprintf("%-8s %-8s %s", tk.node.WidgetType, tk.cuiName, curval) } log.Log(GOCUI, s1, s, end) } diff --git a/dropdown.go b/dropdown.go index ee56331..899e947 100644 --- a/dropdown.go +++ b/dropdown.go @@ -144,6 +144,11 @@ func (tk *guiWidget) showTextbox() { me.textbox.tk.Show() me.textbox.active = true me.textbox.callerTK = tk + r := me.textbox.tk.gocuiSize + me.textbox.tk.full.w0 = r.w0 + me.textbox.tk.full.w1 = r.w1 + me.textbox.tk.full.h0 = r.h0 + me.textbox.tk.full.h1 = r.h1 me.textbox.tk.dumpWidget("showTextbox()") }