diff options
| author | Jeff Carr <[email protected]> | 2025-02-11 13:22:23 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-02-11 13:22:23 -0600 |
| commit | 733c595c54cdbf8e54c7c09c69e8f4d4415b04f6 (patch) | |
| tree | db6659339219677e5179d254f8532ebd3a641ae8 /textbox.go | |
| parent | 535646335af49fa8f27ba28ef62d2f96cac2f451 (diff) | |
disable and enable doesn't crash
Diffstat (limited to 'textbox.go')
| -rw-r--r-- | textbox.go | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -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) |
