NODE: continued work on implementing a node tree

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2021-10-07 21:31:15 -05:00
parent dcdced47db
commit 387b7ead6e
4 changed files with 25 additions and 5 deletions

View File

@ -122,6 +122,11 @@ func DebugDataNodeMap() {
log.Println("Dumping Data.NodeMap:") log.Println("Dumping Data.NodeMap:")
for name, node := range Data.NodeMap { for name, node := range Data.NodeMap {
log.Println("\tData.NodeMap name =", node.Width, node.Height, name) log.Println("\tData.NodeMap name =", node.Width, node.Height, name)
if (node.children == nil) {
log.Println("\t\tNo children")
} else {
log.Println("\t\tHas children:", node.children)
}
// node.SetName("yahoo") // node.SetName("yahoo")
// log.Println("\tData.NodeMap node =", node) // log.Println("\tData.NodeMap node =", node)
} }

View File

@ -129,9 +129,9 @@ func (n *Node) InitTab(title string, custom func() ui.Control) *Node {
os.Exit(-1) os.Exit(-1)
} }
if n.box != nil { if n.box != nil {
log.Println("gui.InitTab() ERROR box already exists") log.Println("gui.InitTab() ERROR box already exists title =", title)
n.Dump() n.Dump()
os.Exit(-1) // os.Exit(-1)
} }
tab := ui.NewTab() tab := ui.NewTab()

View File

@ -132,10 +132,25 @@ func makeWindowDebug() ui.Control {
DumpMap() DumpMap()
}) })
/////////////////////////////////////////////////////
vbox = addGroup(hbox, "Node Debug")
n1 := addButton(vbox, "DebugDataNodeMap()")
n1.OnClicked(func(*ui.Button) {
DebugDataNodeMap()
})
n2 := addButton(vbox, "DebugNodeChildren()")
n2.OnClicked(func(*ui.Button) {
DebugNodeChildren()
})
/*
///////////////////////////////////////////////////// /////////////////////////////////////////////////////
vbox = addGroup(hbox, "Numbers") vbox = addGroup(hbox, "Numbers")
pbar := ui.NewProgressBar() pbar := ui.NewProgressBar()
vbox.Append(pbar, false) vbox.Append(pbar, false)
*/
return hbox return hbox

View File

@ -55,9 +55,9 @@ func InitWindow(gw *GuiWindow, name string, axis int) *GuiBox {
var box *GuiBox var box *GuiBox
if gw == nil { if gw == nil {
box = mapWindow(nil, name, Config.Height, Config.Width) box = mapWindow(nil, name, Config.Width, Config.Height)
} else { } else {
box = mapWindow(gw.UiWindow, name, Config.Height, Config.Width) box = mapWindow(gw.UiWindow, name, Config.Width, Config.Height)
} }
// box.Window = &newGuiWindow // box.Window = &newGuiWindow
@ -66,7 +66,7 @@ func InitWindow(gw *GuiWindow, name string, axis int) *GuiBox {
// This is the first window. One must create it here // This is the first window. One must create it here
if gw == nil { if gw == nil {
log.Println("gui.initWindow() ADDING ui.NewWindow()") log.Println("gui.initWindow() ADDING ui.NewWindow()")
n := uiNewWindow(name, Config.Height, Config.Width) n := uiNewWindow(name, Config.Width, Config.Height)
box.node = n box.node = n
if (n.box == nil) { if (n.box == nil) {
n.box = box n.box = box