From 47b15946de10a75cda026a7317a90d4857b453c8 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sat, 13 Jan 2024 22:02:12 -0600 Subject: work on hiding widgets When widgets are hidden, their state works exactly the same as normal, but updates are not sent to the toolkits Signed-off-by: Jeff Carr --- plugin.go | 42 ------------------------------------------ 1 file changed, 42 deletions(-) (limited to 'plugin.go') diff --git a/plugin.go b/plugin.go index 6623fd4..ff4d512 100644 --- a/plugin.go +++ b/plugin.go @@ -214,48 +214,6 @@ func initToolkit(name string, filename string) *aplug { return newPlug } -// 2024/01/11 finally moving to type any. simplify to just 'value' -// 2023/05/09 pretty clean -// 2023/04/06 Queue() is also being used and channels are being used. -func newAction(n *Node, atype widget.ActionType) *widget.Action { - var a widget.Action - a.ActionType = atype - if (n == nil) { - return &a - } - a.WidgetId = n.id - a.ProgName = n.progname - a.Value = n.value - - a.X = n.X - a.Y = n.Y - - a.AtW = n.AtW - a.AtH = n.AtH - - if (n.parent != nil) { - a.ParentId = n.parent.id - } - a.WidgetType = n.WidgetType - return &a -} - -// sends the action/event to each toolkit via a golang plugin channel -func sendAction(a *widget.Action) { - for _, aplug := range allPlugins { - log.Log(PLUG, "Action() aplug =", aplug.name, "Action type=", a.ActionType) - if (aplug.pluginChan == nil) { - log.Info("Action() retrieving the aplug.PluginChannel()", aplug.name) - aplug.pluginChan = aplug.PluginChannel() - log.Info("Action() retrieved", aplug.pluginChan) - } - log.Info("Action() SEND to pluginChan", aplug.name) - aplug.pluginChan <- *a - // added during debugging. might be a good idea in general for a tactile experience - log.Sleep(.02) // this delay makes it so SetText() works on initial widget creation - } -} - func (n *Node) InitEmbed(resFS embed.FS) *Node { me.resFS = resFS return n -- cgit v1.2.3