From 9c946630a1693d761bddcadabd4e22120f609e1b Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Wed, 3 Nov 2021 01:44:32 -0500 Subject: [PATCH] WINDOW: try to properly destroy a window Signed-off-by: Jeff Carr --- button.go | 6 ++++-- window.go | 7 +++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/button.go b/button.go index 8fddf6e..c1c1c73 100644 --- a/button.go +++ b/button.go @@ -27,8 +27,10 @@ func (n *Node) AddButton(name string, custom func(*Node)) *Node { return n } button := ui.NewButton(name) - log.Println("reflect.TypeOF(uiBox) =", reflect.TypeOf(n.uiBox)) - log.Println("reflect.TypeOF(uiButton) =", reflect.TypeOf(button)) + if (Config.Debug) { + log.Println("reflect.TypeOF(uiBox) =", reflect.TypeOf(n.uiBox)) + log.Println("reflect.TypeOF(uiButton) =", reflect.TypeOf(button)) + } // true == expand, false == make normal size button n.uiBox.Append(button, false) n.uiButton = button diff --git a/window.go b/window.go index ceb9cd1..b776ad6 100644 --- a/window.go +++ b/window.go @@ -120,6 +120,13 @@ func NewWindow() *Node { if (Data.NodeMap[title] != nil) { log.Println("Duplicate window name =", title) + Data.NodeMap[title].Dump() + Data.NodeMap[title].ListChildren(false) + uiW := Data.NodeMap[title].uiWindow + if (uiW != nil) { + uiW.Show() + } + panic("check here to see if window is really alive") return Data.NodeMap[title] }