summaryrefslogtreecommitdiff
path: root/node.go
diff options
context:
space:
mode:
Diffstat (limited to 'node.go')
-rw-r--r--node.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/node.go b/node.go
index c4641f5..f143771 100644
--- a/node.go
+++ b/node.go
@@ -5,10 +5,11 @@ package gui
/*
generic function to create a new node on the binary tree
*/
-func (n *Node) New(title string) *Node {
+func (n *Node) New(title string, t string) *Node {
var newN *Node
newN = addNode(title, n.Width, n.Height)
+ newN.Widget.Type = t
n.Append(newN)
newN.parent = n
@@ -19,7 +20,7 @@ func (n *Node) New(title string) *Node {
raw create function for a new node struct
*/
func addNode(title string, width int, height int) *Node {
- var n Node
+ n := new(Node)
n.Name = title
n.Width = width
@@ -36,5 +37,5 @@ func addNode(title string, width int, height int) *Node {
n.id = Config.counter
Config.counter += 1
- return &n
+ return n
}