From 8ab6e8fcdcbb6060ff4870b41c64aa7de68925ef Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 4 Sep 2025 14:44:14 -0500 Subject: fixes to make the GUI plugins more reliable --- plugin.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'plugin.go') diff --git a/plugin.go b/plugin.go index 3a27b69..e07d046 100644 --- a/plugin.go +++ b/plugin.go @@ -59,6 +59,26 @@ type aplug struct { var allPlugins []*aplug +func (n *Node) LoadToolkitNew(name string) error { + log.Log(PLUG, "LoadToolkit() START for name =", name) + plug := initPlugin(name) + if plug == nil { + return errors.New("initPlugin(" + name + ") failed") + } + plug.dead = false + + log.Log(PLUG, "LoadToolkit() sending Toolkit Init action to the plugin channel") + var a widget.Action + a.ActionType = widget.ToolkitInit + plug.pluginChan <- a + // sleep(.5) // temp hack until chan communication is setup + + // TODO: find a new way to do this that is locking, safe and accurate + me.rootNode.redraw(plug) + log.Log(PLUG, "LoadToolkit() END for name =", name) + return nil +} + func (n *Node) LoadToolkit(name string) (*Node, error) { log.Log(PLUG, "LoadToolkit() START for name =", name) plug := initPlugin(name) -- cgit v1.2.3