summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.go3
-rw-r--r--node.go6
2 files changed, 5 insertions, 4 deletions
diff --git a/main.go b/main.go
index 5ec8bdb..bffbee9 100644
--- a/main.go
+++ b/main.go
@@ -22,7 +22,8 @@ func init() {
me.prefix = "wit"
// Populates the top of the binary tree
- me.rootNode = addNode("guiBinaryTree")
+ me.rootNode = addNode()
+ me.rootNode.progname = "guiBinaryTree"
me.rootNode.WidgetType = widget.Root
me.rootNode.hidden = false // always send the rootNode to the toolkits
diff --git a/node.go b/node.go
index fabaaa4..5ce28a2 100644
--- a/node.go
+++ b/node.go
@@ -11,7 +11,8 @@ import (
func (n *Node) newNode(title string, t widget.WidgetType) *Node {
var newN *Node
- newN = addNode(title)
+ newN = addNode()
+ newN.value = title
newN.WidgetType = t
if n.WidgetType == widget.Grid {
@@ -29,9 +30,8 @@ func (n *Node) newNode(title string, t widget.WidgetType) *Node {
/*
raw create function for a new node struct
*/
-func addNode(title string) *Node {
+func addNode() *Node {
n := new(Node)
- n.label = title
n.id = me.counter
log.Log(NODE, "addNode = widget setid =", n.id)