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)
if n.TK == nil {
log.Log(WARN, "newAdd() Tree sent an action on a widget we didn't seem to have.", n.WidgetId)
// do this init here again? Probably something
// went wrong and we should reset the our while gocui.View tree
if n.WidgetId == 1 || n.WidgetId == 2 {
// this is normal at plugin init() time
} 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)
}
// show(n, !a.State.Hidden)

View File

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