NODE: TODO: refactor InitWindow to use NewWindow()

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2021-10-25 07:18:17 -05:00
parent a678fcd2ad
commit c74e39a9ef
3 changed files with 16 additions and 15 deletions

View File

@ -8,10 +8,6 @@ import (
)
func Main(f func()) {
log.Println("Starting gui.Main() (using gtk via andlabs/ui)")
log.Println("Starting gui.Main() (using gtk via andlabs/ui)")
log.Println("Starting gui.Main() (using gtk via andlabs/ui)")
log.Println("Starting gui.Main() (using gtk via andlabs/ui)")
log.Println("Starting gui.Main() (using gtk via andlabs/ui)")
ui.Main(f)
}

View File

@ -24,10 +24,11 @@ type GuiConfig struct {
Height int
Exit func(*Node)
Debug bool
DebugNode bool
DebugTabs bool
DebugTable bool
Debug bool
DebugNode bool
DebugTabs bool
DebugTable bool
DebugWindow bool
depth int
counter int // used to make unique ID's

View File

@ -135,7 +135,9 @@ func InitWindow(parent *Node, gw *GuiWindow, name string, axis int) *Node {
}
}
if (box.node == nil) {
Data.ListChildren(true)
if (Config.Debug) {
Data.ListChildren(true)
}
log.Println("InitWindow() box has a FUCKING nil node")
fn := FindNode("full initTab")
log.Println("InitWindow() fn =", fn)
@ -143,7 +145,9 @@ func InitWindow(parent *Node, gw *GuiWindow, name string, axis int) *Node {
}
if (newGuiWindow.node == nil) {
Data.ListChildren(true)
if (Config.Debug) {
Data.ListChildren(true)
}
log.Println("InitWindow() newGuiWindow has a FUCKING nil node")
// panic(-1)
}
@ -153,8 +157,10 @@ func InitWindow(parent *Node, gw *GuiWindow, name string, axis int) *Node {
box.Dump()
panic(-1)
}
box.Dump()
box.node.Dump()
if (Config.DebugWindow) {
box.Dump()
box.node.Dump()
}
if (box.node != node) {
log.Println("InitWindow() box.node != node. Hmmm....")
log.Println("InitWindow() box.node != node. Hmmm....")
@ -168,8 +174,7 @@ func InitWindow(parent *Node, gw *GuiWindow, name string, axis int) *Node {
panic(-1)
}
if (node.uiTab == nil) {
// DebugNodeChildren()
// panic("node.uiTab = nil")
panic("node.uiTab = nil")
}
return node
}
@ -372,7 +377,6 @@ func mapWindow(parent *Node, window *ui.Window, title string, x int, y int) *Nod
return nil
}
log.Println("gui.WindowMap START title =", title)
var newGuiWindow GuiWindow
newGuiWindow.Width = x
newGuiWindow.Height = y