summaryrefslogtreecommitdiff
path: root/textbox.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-11 13:22:23 -0600
committerJeff Carr <[email protected]>2025-02-11 13:22:23 -0600
commit733c595c54cdbf8e54c7c09c69e8f4d4415b04f6 (patch)
treedb6659339219677e5179d254f8532ebd3a641ae8 /textbox.go
parent535646335af49fa8f27ba28ef62d2f96cac2f451 (diff)
disable and enable doesn't crash
Diffstat (limited to 'textbox.go')
-rw-r--r--textbox.go16
1 files changed, 10 insertions, 6 deletions
diff --git a/textbox.go b/textbox.go
index bc5c902..ffc2812 100644
--- a/textbox.go
+++ b/textbox.go
@@ -29,14 +29,18 @@ func (tk *guiWidget) forceSizes(r *rectType) {
tk.force.h1 = r.h1
}
-func (callertk *guiWidget) prepTextbox() {
+func initTextbox() {
if me.textbox.tk == nil {
// should only happen once
me.textbox.tk = makeNewFlagWidget(me.textbox.wId)
// me.textbox.tk.dumpWidget("init() textbox")
}
+}
+
+func (callertk *guiWidget) prepTextbox() {
+ initTextbox()
if me.textbox.tk == nil {
- log.Log(GOCUI, "showTextbox() Is Broken")
+ log.Log(GOCUI, "prepTextbox() Is Broken")
return
}
@@ -51,14 +55,14 @@ func (callertk *guiWidget) prepTextbox() {
me.textbox.callerTK = callertk
- showTextbox(callertk.String())
+ // showTextbox(callertk.String())
}
-func showTextbox(callertk string) {
+func showTextbox(callers string) {
// tk := me.textbox.tk
// me.textbox.tk.dumpWidget("after sizes")
- me.textbox.tk.Show() // actually makes the gocui view. TODO: redo this
+ // me.textbox.tk.Show() // actually makes the gocui view. TODO: redo this
if me.textbox.tk.v == nil {
log.Info("wtf went wrong")
@@ -67,7 +71,7 @@ func showTextbox(callertk string) {
me.textbox.tk.setColorModal()
me.textbox.tk.v.Clear()
- cur := strings.TrimSpace(callertk)
+ cur := strings.TrimSpace(callers)
// log.Info("setting textbox string to:", cur)
me.textbox.tk.v.WriteString(cur)