summaryrefslogtreecommitdiff
path: root/new-structs.go
diff options
context:
space:
mode:
Diffstat (limited to 'new-structs.go')
-rw-r--r--new-structs.go13
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)