summaryrefslogtreecommitdiff
path: root/node.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-04-28 10:30:27 -0500
committerJeff Carr <[email protected]>2023-04-28 10:30:27 -0500
commit03942de00e133daf59da8ed3b6c3e71ce8afe316 (patch)
treea5d5e4b3899631d939b90d1cfa21bc165be76695 /node.go
parent8b5f8fe42d9b161090ff91960050565959ac65dd (diff)
further code cleanups
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'node.go')
-rw-r--r--node.go22
1 files changed, 3 insertions, 19 deletions
diff --git a/node.go b/node.go
index 85c7fb9..0cfec19 100644
--- a/node.go
+++ b/node.go
@@ -12,7 +12,7 @@ func (n *Node) newNode(title string, t toolkit.WidgetType, custom func()) *Node
newN.WidgetType = t
newN.Custom = custom
- n.Append(newN)
+ n.children = append(n.children, newN)
newN.parent = n
return newN
}
@@ -35,30 +35,14 @@ func (n *Node) Parent() *Node {
return n.parent
}
-/*
-func (n *Node) Window() *Node {
- return n.parent
-}
-*/
-
-func (n *Node) Append(child *Node) {
- n.children = append(n.children, child)
- if (debugNode) {
- log(debugNode, "child node:")
- child.Dump(debugDump)
- log(debugNode, "parent node:")
- n.Dump(debugDump)
- }
-}
-
func (n *Node) Delete(d *Node) {
for i, child := range n.children {
- log(debugNode, "\t", i, child.id, child.Width, child.Height, child.Name)
+ log(debugNode, "\t", i, child.id, child.Name)
if (child.id == d.id) {
log(debugNode, "\t\t Deleting this")
n.children = append(n.children[:i], n.children[i+1:]...)
return
}
}
- log(debugError, "did not find node to delete", d.id, d.Width, d.Height, d.Name)
+ log(debugError, "did not find node to delete", d.id, d.Name)
}