diff options
| author | Jeff Carr <[email protected]> | 2021-10-09 10:46:57 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2021-10-09 10:46:57 -0500 |
| commit | e002f833209109763e9df90d91b9ef0f498b22b5 (patch) | |
| tree | 6dca61decdf3d339c712381f940051043ffcb3b3 /new-structs.go | |
| parent | e45a106d95e3043828735cf76aa487af837a2137 (diff) | |
NODE: climbing up the rabbit hole
Diffstat (limited to 'new-structs.go')
| -rw-r--r-- | new-structs.go | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/new-structs.go b/new-structs.go index ffe83d4..ffc90b9 100644 --- a/new-structs.go +++ b/new-structs.go @@ -70,7 +70,11 @@ func (n *Node) Dump() { log.Println("gui.Node.Dump() Width = ", n.Width) log.Println("gui.Node.Dump() Height = ", n.Height) - log.Println("gui.Node.Dump() parent = ", n.parent) + if (n.parent == nil) { + log.Println("gui.Node.Dump() parent = nil") + } else { + log.Println("gui.Node.Dump() parent = ", n.parent.id) + } log.Println("gui.Node.Dump() children = ", n.children) log.Println("gui.Node.Dump() window = ", n.window) @@ -204,7 +208,7 @@ func findByName(node *Node, name string) *Node { return nil } -func (parent *Node) AddTab(title string) *Node { +func (parent *Node) AddTab(title string, uiC ui.Control) *Node { if parent.uiWindow == nil { parent.Dump() panic("gui.AddTab() ERROR ui.Window == nil") @@ -226,7 +230,10 @@ func (parent *Node) AddTab(title string) *Node { tab := parent.uiTab parent.uiWindow.SetMargined(true) - tab.Append(title, initBlankWindow()) + if (uiC == nil) { + uiC = parent.initBlankWindow() + } + tab.Append(title, uiC) tab.SetMargined(0, true) newNode := parent.makeNode(title, 555, 600 + Config.counter) |
