NODE: walking around in the rabbit hole

This commit is contained in:
Jeff Carr 2021-10-09 11:23:27 -05:00
parent b3e00c173b
commit 9ea89ac01f
3 changed files with 25 additions and 6 deletions

View File

@ -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()
}

View File

@ -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()

View File

@ -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) {