From 9ef16c1bf2bfc1e00163b461779383c809efff9f Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Mon, 3 Mar 2025 03:45:36 -0600 Subject: better tree init() --- treeInit.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'treeInit.go') diff --git a/treeInit.go b/treeInit.go index 7fc1c73..4443264 100644 --- a/treeInit.go +++ b/treeInit.go @@ -32,6 +32,9 @@ package main */ import ( + "time" + + log "go.wit.com/log" "go.wit.com/toolkits/tree" "go.wit.com/widget" ) @@ -48,7 +51,20 @@ func Callback(guiCallback chan widget.Action) { } func PluginChannel() chan widget.Action { + log.Info("PluginChannel() INIT(l)") + log.Info("PluginChannel() INIT(l)") + log.Info("PluginChannel() INIT(l)") initOnce.Do(initPlugin) + for { + if me.myTree != nil { + break + } + log.Info("me.myTree == nil") + time.Sleep(300 * time.Millisecond) + } + log.Info("PluginChannel() DONE()") + log.Info("PluginChannel() DONE()") + log.Info("PluginChannel() DONE()") return me.myTree.PluginChannel() } -- cgit v1.2.3