diff options
| author | Jeff Carr <[email protected]> | 2021-10-09 06:38:32 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2021-10-09 06:38:32 -0500 |
| commit | 663b031c8f22f3c58de29410c9764abf2f29b095 (patch) | |
| tree | 8f08b1ac1461f9911abc9ae4e73caf653a0d65e8 /window.go | |
| parent | 822a1c8f2aeeda6b36437cf06c0fa65a45df29ef (diff) | |
NODE: walking around in the rabbit hole
Diffstat (limited to 'window.go')
| -rw-r--r-- | window.go | 27 |
1 files changed, 25 insertions, 2 deletions
@@ -213,23 +213,46 @@ func CreateWindow(title string, tabname string, x int, y int, custom func() ui.C log.Println("SERIOUS ERROR n.box == nil in CreateWindow()") log.Println("SERIOUS ERROR n.box == nil in CreateWindow()") } - n.InitTab(title) + n.AddTab(title) // TODO: run custom() here // Oct 9 return n } +func (n *Node) Add(e Element) *Node { + newNode := n.addNode("testingAdd") + if(e == Tab) { + log.Println("gui.Add() SHOULD ADD element =", e.String()) + } + return newNode +} + // // Create a new node // if parent == nil, that means it is a new window and needs to be put // in the window map (aka Data.NodeMap) // +func (parent *Node) addNode(title string) *Node { + var node Node + node.Name = title + node.Width = parent.Width + node.Height = parent.Height + node.parent = parent + + id := Config.prefix + strconv.Itoa(Config.counter) + Config.counter += 1 + node.id = id + + parent.Append(&node) + return &node +} + func makeNode(parent *Node, title string, x int, y int) *Node { var node Node node.Name = title node.Width = x node.Height = y - id := "jwc" + strconv.Itoa(Config.counter) + id := Config.prefix + strconv.Itoa(Config.counter) Config.counter += 1 node.id = id |
