some crippled dumb refresh code kinda makes init() work for now

This commit is contained in:
Jeff Carr 2025-03-02 18:16:56 -06:00
parent dc329ed18c
commit 4b79e862a7
2 changed files with 12 additions and 0 deletions

View File

@ -243,6 +243,13 @@ func refreshGocui() {
// redraw the windows if something has changed
if time.Since(lastRefresh) > 1000*time.Millisecond {
if me.refresh {
if me.stdout.outputOnTop {
me.stdout.outputOnTop = false
setThingsOnTop()
} else {
me.stdout.outputOnTop = true
setThingsOnTop()
}
log.Info("refresh triggered")
me.newWindowTrigger <- me.treeRoot.TK.(*guiWidget)
me.refresh = false

View File

@ -36,15 +36,18 @@ func newAdd(n *tree.Node) {
*/
w := n.TK.(*guiWidget)
w.Show()
me.refresh = true // testing code to see if refresh can work
}
// for gocui as a GUI plugin, SetTitle & SetLabel are identical to SetText
func setTitle(n *tree.Node, s string) {
setText(n, s)
me.refresh = true // testing code to see if refresh can work
}
func setLabel(n *tree.Node, s string) {
setText(n, s)
me.refresh = true // testing code to see if refresh can work
}
// setText() and addText() are simple. They take the event sent
@ -61,6 +64,7 @@ func setText(n *tree.Node, s string) {
}
w := n.TK.(*guiWidget)
w.SetText(s)
me.refresh = true // testing code to see if refresh can work
}
func addText(n *tree.Node, s string) {
@ -74,6 +78,7 @@ func addText(n *tree.Node, s string) {
}
w := n.TK.(*guiWidget)
w.AddText(s)
me.refresh = true // testing code to see if refresh can work
}
func (w *guiWidget) deleteGocuiViews() {