summaryrefslogtreecommitdiff
path: root/new-structs.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2021-10-09 07:13:58 -0500
committerJeff Carr <[email protected]>2021-10-09 07:13:58 -0500
commite45a106d95e3043828735cf76aa487af837a2137 (patch)
tree443cc8be2244c1caa5a0371ad78ace8210ba601c /new-structs.go
parent663b031c8f22f3c58de29410c9764abf2f29b095 (diff)
NODE: walking around in the rabbit hole
Diffstat (limited to 'new-structs.go')
-rw-r--r--new-structs.go35
1 files changed, 9 insertions, 26 deletions
diff --git a/new-structs.go b/new-structs.go
index 1089fcf..ffe83d4 100644
--- a/new-structs.go
+++ b/new-structs.go
@@ -47,11 +47,13 @@ type Node struct {
parent *Node
children []*Node
+ window *GuiWindow
box *GuiBox
uiControl *ui.Control
uiWindow *ui.Window
uiTab *ui.Tab
+ uiBox *ui.Box
}
func (n *Node) Parent() *Node {
@@ -67,12 +69,17 @@ func (n *Node) Dump() {
log.Println("gui.Node.Dump() Name = ", n.Name)
log.Println("gui.Node.Dump() Width = ", n.Width)
log.Println("gui.Node.Dump() Height = ", n.Height)
+
log.Println("gui.Node.Dump() parent = ", n.parent)
log.Println("gui.Node.Dump() children = ", n.children)
+
+ log.Println("gui.Node.Dump() window = ", n.window)
log.Println("gui.Node.Dump() box = ", n.box)
- log.Println("gui.Node.Dump() uiControl = ", n.uiControl)
+
log.Println("gui.Node.Dump() uiWindow = ", n.uiWindow)
log.Println("gui.Node.Dump() uiTab = ", n.uiTab)
+ log.Println("gui.Node.Dump() uiBox = ", n.uiBox)
+ log.Println("gui.Node.Dump() uiControl = ", n.uiControl)
if (n.id == "") {
panic("gui.Node.Dump() id == nil")
}
@@ -197,30 +204,6 @@ func findByName(node *Node, name string) *Node {
return nil
}
-/*
-func (parent *Node) InitTab(title string) *Node {
- if parent.uiWindow == nil {
- parent.Dump()
- panic("gui.InitTab() ERROR ui.Window == nil")
- }
- if parent.box == nil {
- parent.Dump()
- panic("gui.InitTab() ERROR box == nil")
- }
-
- tab := ui.NewTab()
- parent.uiWindow.SetChild(tab)
- parent.uiWindow.SetMargined(true)
- parent.uiTab = tab
-
- tab.Append(title, initBlankWindow())
- tab.SetMargined(0, true)
-
- newNode := makeNode(parent, title, 555, 600 + Config.counter)
- return newNode
-}
-*/
-
func (parent *Node) AddTab(title string) *Node {
if parent.uiWindow == nil {
parent.Dump()
@@ -246,7 +229,7 @@ func (parent *Node) AddTab(title string) *Node {
tab.Append(title, initBlankWindow())
tab.SetMargined(0, true)
- newNode := makeNode(parent, title, 555, 600 + Config.counter)
+ newNode := parent.makeNode(title, 555, 600 + Config.counter)
newNode.uiTab = tab
return newNode
}