From ec829f6e2be515b717d0ebd20b56623e44aff810 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 9 Feb 2024 10:26:42 -0600 Subject: binary tree is global Signed-off-by: Jeff Carr --- init.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'init.go') diff --git a/init.go b/init.go index ac5fb09..53d17c2 100644 --- a/init.go +++ b/init.go @@ -2,6 +2,7 @@ package tree import ( "errors" + "os" "runtime/debug" "sync" @@ -13,7 +14,7 @@ var muAction sync.Mutex // TODO: add checks for nil function pointers func (me *TreeInfo) newAction(a widget.Action) { - n := me.treeRoot.FindWidgetId(a.WidgetId) + n := treeRoot.FindWidgetId(a.WidgetId) switch a.ActionType { case widget.Add: if n == nil { @@ -83,6 +84,9 @@ func (me *TreeInfo) catchActionChannel() { me.SendToolkitPanic() debug.PrintStack() me.ToolkitClose() + if me.PluginName == "nocui" { + os.Exit(-1) + } } }() log.Log(TREE, "catchActionChannel() START") @@ -108,12 +112,6 @@ func New() *TreeInfo { me := new(TreeInfo) me.pluginChan = make(chan widget.Action, 1) - /* - full := "go.wit.com/gui" - short := "gui" - TREE = log.NewFlag("TREE", true, full, short, "treeRoot info") - */ - log.Log(TREE, "Init() start channel reciever") go me.catchActionChannel() log.Log(TREE, "Init() END") -- cgit v1.2.3