summaryrefslogtreecommitdiff
path: root/node.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-02-25 14:05:25 -0600
committerJeff Carr <[email protected]>2023-02-25 14:05:25 -0600
commitf3bb68396afa7452ecf1c8d4744c825a9d81057c (patch)
tree00b55a17cee7a8e2f795c479a84a844779993c1c /node.go
parent355e5ec968427c2b07b78fec12224f31a65df740 (diff)
The debugging window is finally useful
the gui enabled debugging works --gui-debug works from the command line The debug window can now select things debugging now includes widget types all the debug flags work finally working debugging flags via gui checkboxes add debian packaging rules use log() in the toolkit use a standard log() to simplify debugging flags add reference to 'GO Style Guide' use the same LICENSE from the GO developers. TODO: make this threadsafe TODO: fix plugin stuff Signed-off-by: Jeff Carr <[email protected]>
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
}