disable the whole screen while things are waiting

This commit is contained in:
Jeff Carr 2025-02-09 14:35:11 -06:00
parent 7d793c68db
commit 6ea6ffaa3d
2 changed files with 13 additions and 8 deletions

View File

@ -229,7 +229,9 @@ func (tk *guiWidget) Disable() {
// log.Info("disable widget in gocui", tk.node.WidgetType, tk.node.ProgName())
switch tk.node.WidgetType {
case widget.Box:
log.Info("todo: blank out the window here")
tk.labelN = "Running..."
// log.Info("todo: blank out the window here", tk.String())
tk.showTextbox()
return
case widget.Button:
tk.setColorDisable()
@ -249,7 +251,10 @@ func (tk *guiWidget) Enable() {
// log.Info("enable widget in gocui", tk.node.WidgetType, tk.node.ProgName())
switch tk.node.WidgetType {
case widget.Box:
// log.Info("todo: blank out the window here")
// log.Info("todo: un blank the window here")
me.textbox.tk.Hide()
me.textbox.active = false
// log.Info("escaped from textbox")
return
case widget.Button:
tk.restoreEnableColor()

View File

@ -75,7 +75,12 @@ func (w *guiWidget) deleteView() {
}
func (tk *guiWidget) String() string {
curval := strings.TrimSpace(tk.node.GetLabel())
// deprecate this?
curval := strings.TrimSpace(tk.labelN)
if curval != "" {
return curval
}
curval = strings.TrimSpace(tk.node.GetLabel())
if curval != "" {
return curval
}
@ -91,11 +96,6 @@ func (tk *guiWidget) String() string {
if curval != "" {
return curval
}
// deprecate this?
curval = strings.TrimSpace(tk.labelN)
if curval != "" {
return curval
}
return ""
}