From 25ed10c0ec74280fc8280b397f8bd673371b796a Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 11 Jan 2024 22:17:02 -0600 Subject: [PATCH] api update Signed-off-by: Jeff Carr --- main.go | 3 ++- node.go | 6 +++--- 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)