WINDOW: try to properly destroy a window

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2021-11-03 01:44:32 -05:00
parent 9960652ec7
commit 9c946630a1
2 changed files with 11 additions and 2 deletions

View File

@ -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

View File

@ -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]
}