TODO: delete windows (kindof)

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2021-11-03 23:55:58 -05:00
parent 9aa7dda6f9
commit f6fe1a503f
3 changed files with 16 additions and 8 deletions

View File

@ -74,3 +74,11 @@ func delayedTabs() {
log.Println("delayedTabs() could have added a tab here\n")
// jcarrWindow.AddTab("delayed tab", nil)
}
func normalWindowClose(n *gui.Node) {
origlog.Println("TODO: close this window correctly and empty the node")
n.Dump()
name := n.Name
// TODO: this is probably some sort of terrible and wrong memory leak
delete(gui.Data.NodeMap, name)
}

View File

@ -37,13 +37,6 @@ func tabResets(w *gui.Node) *gui.Node {
updateDNS(nil)
})
g1.AddButton("fontNode.GetText()", func (*gui.Node) {
if (fontNode != nil) {
fontsize = fontNode.GetText()
log.Println("set fontsize =", fontsize)
}
})
aptGroup(newTab)
newTab.MakeBasicControlsPage("testing stuff")

View File

@ -13,7 +13,7 @@ func xtermSettings(w *gui.Node) {
gui.Config.Title = "Configure xterm"
gui.Config.Width = 105
gui.Config.Height = 105
gui.Config.Exit = nil
gui.Config.Exit = normalWindowClose
w = gui.NewWindow()
}
@ -50,4 +50,11 @@ func xtermSettings(w *gui.Node) {
cmd := "xterm"
xterm(cmd)
})
gNode.AddButton("fontNode.GetText()", func (*gui.Node) {
if (fontNode != nil) {
fontsize = fontNode.GetText()
log.Println("set fontsize =", fontsize)
}
})
}