output window works with keypress 'L'

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-11-14 03:50:59 -06:00
parent 368c25107a
commit 2461df0153
1 changed files with 26 additions and 18 deletions

View File

@ -134,14 +134,15 @@ func addDebugKeys(g *gocui.Gui) {
func(g *gocui.Gui, v *gocui.View) error {
me.treeRoot.ListWidgets()
w := me.logStdout.TK.(*guiWidget)
msg := fmt.Sprintf("test out %d\n", ecount)
msg += fmt.Sprintf("test out %d\n", ecount)
msg += fmt.Sprintf("test out %d\n", ecount)
w.Write([]byte(msg + msg + msg))
w.Write([]byte(msg + msg + msg))
w.Write([]byte(msg + msg + msg))
w.Write([]byte(msg + msg + msg))
tk := me.logStdout.TK.(*guiWidget)
msg := fmt.Sprintf("test out kb %d\n", ecount)
tk.Write([]byte(msg))
if tk == nil {
log.Log(ERROR, "tk = nil")
}
if tk.v == nil {
log.Log(ERROR, "tk.v = nil")
}
return nil
})
@ -164,16 +165,23 @@ func addDebugKeys(g *gocui.Gui) {
// log to output window
g.SetKeybinding("", 'o', gocui.ModNone,
func(g *gocui.Gui, v *gocui.View) error {
log.Log(ERROR, "TODO: re-implement this")
/*
if me.logStdout.Visible() {
me.logStdout.SetVisible(false)
// setOutput(os.Stdout)
} else {
me.logStdout.SetVisible(true)
// setOutput(me.logStdout.tk)
}
*/
log.Log(ERROR, "TODO: trying re-implement this")
tk := me.logStdout.TK.(*guiWidget)
if tk == nil {
log.Log(ERROR, "tk = nil")
}
if tk.v == nil {
log.Log(ERROR, "tk.v = nil")
}
if tk.Visible() {
log.Log(ERROR, "setting visible to false")
tk.SetVisible(false)
// setOutput(os.Stdout)
} else {
log.Log(ERROR, "setting visible to true")
tk.SetVisible(true)
// setOutput(me.logStdout.tk)
}
return nil
})