diff options
Diffstat (limited to 'new-structs.go')
| -rw-r--r-- | new-structs.go | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/new-structs.go b/new-structs.go index df25cae..d6ff409 100644 --- a/new-structs.go +++ b/new-structs.go @@ -16,12 +16,13 @@ type Node struct { Height int children []*Node + box *GuiBox control *ui.Control window *ui.Window } -func (n Node) SetName(name string) { +func (n *Node) SetName(name string) { // n.uiType.SetName(name) if (n.window != nil) { log.Println("node is a window. setting title =", name) @@ -32,15 +33,30 @@ func (n Node) SetName(name string) { return } -func (n Node) Append(child Node) { +func (n *Node) FindWindowBox() *GuiBox { + if (n.box == nil) { + log.Println("SERIOUS ERROR n.box == nil in FindWindowBox()") + log.Println("SERIOUS ERROR n.box == nil in FindWindowBox()") + log.Println("SERIOUS ERROR n.box == nil in FindWindowBox()") + log.Println("SERIOUS ERROR n.box == nil in FindWindowBox()") + } + return n.box +} + +func (n *Node) Append(child Node) { // if (n.UiBox == nil) { // return // } // n.uiType.Append(child, x) } +func (n *Node) List() { + findByIdDFS(n, "test") +} func findByIdDFS(node *Node, id string) *Node { + log.Println("findByIdDFS()", id, node) if node.id == id { + log.Println("Found node id =", id, node) return node } |
