From 5005edc9e37cb207f6c6035ea6fe3c3d98d94caa Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Mon, 20 Jan 2025 05:06:08 -0600 Subject: add a 'app' defined default plugin variable --- init.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'init.go') diff --git a/init.go b/init.go index 4dfbf07..3883fa1 100644 --- a/init.go +++ b/init.go @@ -280,6 +280,12 @@ func (n *Node) Default() *Node { log.Log(WARN, "LoadToolkit() failed for =", argGui.GuiPlugin) return nil } + if me.appPlugin != "" { + if n, err = n.LoadToolkit(me.appPlugin); err == nil { + return n + } + } + // if DISPLAY isn't set, return since gtk can't load // TODO: figure out how to check what to do in macos and mswindows if os.Getenv("DISPLAY") == "" { @@ -393,3 +399,9 @@ func trapStdout() { // defer guioutf.Close() } + +// sets the applications requested plugin +// the command line arguements override this +func (n *Node) SetAppDefaultPlugin(plugname string) { + me.appPlugin = plugname +} -- cgit v1.2.3