From 89d65118cdf4e85074ab369ce700defe9f22eb6b Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 23 Apr 2023 11:30:54 -0500 Subject: [PATCH] return to normal plugin load order Signed-off-by: Jeff Carr --- README-goreadme.md | 2 +- main.go | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README-goreadme.md b/README-goreadme.md index 0b9a917..ea16866 100644 --- a/README-goreadme.md +++ b/README-goreadme.md @@ -139,7 +139,7 @@ Creates a window helpful for debugging this package `func ShowDebugValues()` -### func [StandardExit](/main.go#L180) +### func [StandardExit](/main.go#L182) `func StandardExit()` diff --git a/main.go b/main.go index 9e37080..63cbf42 100644 --- a/main.go +++ b/main.go @@ -154,18 +154,20 @@ func New() *Node { return Config.rootNode } +// try to load andlabs, if that doesn't work, fall back to the console func (n *Node) Default() *Node { - if (n.LoadToolkit("gocui") == nil) { - log(logError, "New() failed to load gocui") - } // 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") == "") { + if (n.LoadToolkit("gocui") == nil) { + log(logError, "New() failed to load gocui") + } return n } - if (n.LoadToolkit("andlabs") == nil) { - log(logError, "New() failed to load andlabs") + if (n.LoadToolkit("andlabs") != nil) { + return n } + n.LoadToolkit("gocui") return n }