quiet output related to expected init() conditions

This commit is contained in:
Jeff Carr 2025-03-10 04:37:21 -05:00
parent bdb93a7b57
commit cb3047ab09
2 changed files with 8 additions and 4 deletions

10
add.go
View File

@ -60,9 +60,13 @@ func newAdd(n *tree.Node) {
} }
add(n) add(n)
if n.TK == nil { if n.TK == nil {
log.Log(WARN, "newAdd() Tree sent an action on a widget we didn't seem to have.", n.WidgetId) if n.WidgetId == 1 || n.WidgetId == 2 {
// do this init here again? Probably something // this is normal at plugin init() time
// went wrong and we should reset the our while gocui.View tree } else {
// this probably shouldn't be happening
log.Log(WARN, "newAdd() Tree sent an action on a widget we didn't seem to have.", n.WidgetId, n.WidgetType, n.ProgName())
}
// Probably something went wrong and we should reset / redraw everything?
n.TK = initWidget(n) n.TK = initWidget(n)
} }
// show(n, !a.State.Hidden) // show(n, !a.State.Hidden)

View File

@ -26,7 +26,7 @@ func newWindow(p, n *tree.Node) {
win.SetBorderless(n.State.Borderless) win.SetBorderless(n.State.Borderless)
win.SetMargined(n.State.Pad) win.SetMargined(n.State.Pad)
win.OnClosing(func(*ui.Window) bool { win.OnClosing(func(*ui.Window) bool {
// show(n, false) newt.uiWindow = nil // delete the local reference to the window
me.myTree.SendWindowCloseEvent(n) me.myTree.SendWindowCloseEvent(n)
// n.DeleteNode() // n.DeleteNode()
return true return true