NODE: TODO: refactor InitWindow to use NewWindow()
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
a678fcd2ad
commit
c74e39a9ef
4
main.go
4
main.go
|
@ -8,10 +8,6 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func Main(f func()) {
|
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)")
|
log.Println("Starting gui.Main() (using gtk via andlabs/ui)")
|
||||||
ui.Main(f)
|
ui.Main(f)
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,10 +24,11 @@ type GuiConfig struct {
|
||||||
Height int
|
Height int
|
||||||
Exit func(*Node)
|
Exit func(*Node)
|
||||||
|
|
||||||
Debug bool
|
Debug bool
|
||||||
DebugNode bool
|
DebugNode bool
|
||||||
DebugTabs bool
|
DebugTabs bool
|
||||||
DebugTable bool
|
DebugTable bool
|
||||||
|
DebugWindow bool
|
||||||
|
|
||||||
depth int
|
depth int
|
||||||
counter int // used to make unique ID's
|
counter int // used to make unique ID's
|
||||||
|
|
18
window.go
18
window.go
|
@ -135,7 +135,9 @@ func InitWindow(parent *Node, gw *GuiWindow, name string, axis int) *Node {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (box.node == nil) {
|
if (box.node == nil) {
|
||||||
Data.ListChildren(true)
|
if (Config.Debug) {
|
||||||
|
Data.ListChildren(true)
|
||||||
|
}
|
||||||
log.Println("InitWindow() box has a FUCKING nil node")
|
log.Println("InitWindow() box has a FUCKING nil node")
|
||||||
fn := FindNode("full initTab")
|
fn := FindNode("full initTab")
|
||||||
log.Println("InitWindow() fn =", fn)
|
log.Println("InitWindow() fn =", fn)
|
||||||
|
@ -143,7 +145,9 @@ func InitWindow(parent *Node, gw *GuiWindow, name string, axis int) *Node {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newGuiWindow.node == nil) {
|
if (newGuiWindow.node == nil) {
|
||||||
Data.ListChildren(true)
|
if (Config.Debug) {
|
||||||
|
Data.ListChildren(true)
|
||||||
|
}
|
||||||
log.Println("InitWindow() newGuiWindow has a FUCKING nil node")
|
log.Println("InitWindow() newGuiWindow has a FUCKING nil node")
|
||||||
// panic(-1)
|
// panic(-1)
|
||||||
}
|
}
|
||||||
|
@ -153,8 +157,10 @@ func InitWindow(parent *Node, gw *GuiWindow, name string, axis int) *Node {
|
||||||
box.Dump()
|
box.Dump()
|
||||||
panic(-1)
|
panic(-1)
|
||||||
}
|
}
|
||||||
box.Dump()
|
if (Config.DebugWindow) {
|
||||||
box.node.Dump()
|
box.Dump()
|
||||||
|
box.node.Dump()
|
||||||
|
}
|
||||||
if (box.node != node) {
|
if (box.node != node) {
|
||||||
log.Println("InitWindow() box.node != node. Hmmm....")
|
log.Println("InitWindow() box.node != node. Hmmm....")
|
||||||
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)
|
panic(-1)
|
||||||
}
|
}
|
||||||
if (node.uiTab == nil) {
|
if (node.uiTab == nil) {
|
||||||
// DebugNodeChildren()
|
panic("node.uiTab = nil")
|
||||||
// panic("node.uiTab = nil")
|
|
||||||
}
|
}
|
||||||
return node
|
return node
|
||||||
}
|
}
|
||||||
|
@ -372,7 +377,6 @@ func mapWindow(parent *Node, window *ui.Window, title string, x int, y int) *Nod
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Println("gui.WindowMap START title =", title)
|
|
||||||
var newGuiWindow GuiWindow
|
var newGuiWindow GuiWindow
|
||||||
newGuiWindow.Width = x
|
newGuiWindow.Width = x
|
||||||
newGuiWindow.Height = y
|
newGuiWindow.Height = y
|
||||||
|
|
Loading…
Reference in New Issue