From 9ea89ac01ffd24d6daa325d72a59a46cc3ad37dc Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sat, 9 Oct 2021 11:23:27 -0500 Subject: [PATCH] NODE: walking around in the rabbit hole --- main.go | 4 ++-- new-structs.go | 17 +++++++++++++++++ structs.go | 10 ++++++---- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index 0876e4a..688e949 100644 --- a/main.go +++ b/main.go @@ -36,7 +36,7 @@ func ExampleWindow() { window := box.Window log.Println("box =", box) log.Println("window =", window) - box.AddDebugTab("jcarr Debug") + // box.AddDebugTab("jcarr Debug") window.UiWindow.Show() } @@ -50,7 +50,7 @@ func DebugWindow() { window := box.Window log.Println("box =", box) log.Println("window =", window) - box.AddDebugTab("jcarr Debug") + // box.AddDebugTab("jcarr Debug") window.UiWindow.Show() } diff --git a/new-structs.go b/new-structs.go index ffc90b9..d6741c4 100644 --- a/new-structs.go +++ b/new-structs.go @@ -90,6 +90,10 @@ func (n *Node) Dump() { } +func (n *Node) SetBox(box *GuiBox) { + n.box = box +} + func (n *Node) SetName(name string) { // n.uiType.SetName(name) if (n.uiWindow != nil) { @@ -208,6 +212,19 @@ func findByName(node *Node, name string) *Node { return nil } +func (parent *Node) AddTabNode(title string, n *Node) *Node { + // Ybox := gui.NewBox(box, gui.Yaxis, "Working Stuff") + // var baseControl ui.Control + // baseControl = Ybox.UiBox + // return baseControl + + parent.Dump() + + newNode := parent.makeNode(title, 444, 400 + Config.counter) + newNode.uiTab = parent.uiTab + return newNode +} + func (parent *Node) AddTab(title string, uiC ui.Control) *Node { if parent.uiWindow == nil { parent.Dump() diff --git a/structs.go b/structs.go index f15a0e0..b7520d1 100644 --- a/structs.go +++ b/structs.go @@ -186,7 +186,7 @@ func (s GuiBox) Append(child ui.Control, x bool) { s.UiBox.Append(child, x) } - +/* func (s *GuiBox) AddTab(title string, custom ui.Control) *ui.Tab { if s.Window == nil { return nil @@ -199,6 +199,7 @@ func (s *GuiBox) AddTab(title string, custom ui.Control) *ui.Tab { tab.Append(title, custom) return tab } +*/ /* func (s GuiBox) AddBoxTab(title string) *GuiBox { @@ -218,9 +219,10 @@ func (n *Node) AddDemoTab(title string) { tabSetMargined(newNode.uiTab) } -func (s GuiBox) AddDebugTab(title string) { - uiTab := s.AddTab(title, makeWindowDebug()) - tabSetMargined(uiTab) +func (n *Node) AddDebugTab(title string) { + newNode := n.AddTab(title, makeWindowDebug()) + newNode.Dump() + tabSetMargined(newNode.uiTab) } func tabSetMargined(tab *ui.Tab) {