summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-03-10 04:37:21 -0500
committerJeff Carr <[email protected]>2025-03-10 04:37:21 -0500
commitcb3047ab097a86236248cd2cd39e25164b39b780 (patch)
tree325ec75f6d4144c671abef4f770ca2d7ba8fb956
parentbdb93a7b57dd524ba5e8848ef88649bb16985f79 (diff)
-rw-r--r--add.go10
-rw-r--r--window.go2
2 files changed, 8 insertions, 4 deletions
diff --git a/add.go b/add.go
index 24d7149..f110834 100644
--- a/add.go
+++ b/add.go
@@ -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)
diff --git a/window.go b/window.go
index 0f73eb3..76177d4 100644
--- a/window.go
+++ b/window.go
@@ -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