summaryrefslogtreecommitdiff
path: root/init.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-09 03:54:23 -0500
committerJeff Carr <[email protected]>2025-09-09 03:54:23 -0500
commit507d3dac4e0f22a463ed0f2f6486576c5c9a0d23 (patch)
tree12014e20fccdc10600031ac586f1c9df2d105cda /init.go
parent1441f90e5a4032c7419e252cc12c6e406d996ed3 (diff)
cleanup gui args
Diffstat (limited to 'init.go')
-rw-r--r--init.go55
1 files changed, 23 insertions, 32 deletions
diff --git a/init.go b/init.go
index b2e9f18..8b8d856 100644
--- a/init.go
+++ b/init.go
@@ -48,7 +48,11 @@ func colorBanner() {
if version == "" {
log.Warn("Warning: compiled without version", err)
}
- time.Sleep(1200 * time.Millisecond) // done for effect
+ if me.postMustParse != nil {
+ log.Info("VERBOSE =", me.postMustParse("VERBOSE"))
+ log.Info("FILE =", me.postMustParse("FILE"))
+ }
+ time.Sleep(3200 * time.Millisecond) // done for effect
}
// what genius figured this out?
@@ -300,10 +304,11 @@ func (n *Node) gotUserEvent(a widget.Action) {
log.Log(CHANGE, "a Custom() function was not set for this widget")
return
}
- go something(n)
+ go runWhateverCrazyThingTheAppDeveloperDid(n)
}
-func something(n *Node) {
+// I guess do things this way? This could do anything so no promises I guess.
+func runWhateverCrazyThingTheAppDeveloperDid(n *Node) {
defer func() {
if r := recover(); r != nil {
Crash(r, "watchCallback()")
@@ -312,54 +317,40 @@ func something(n *Node) {
n.Custom()
}
+// deprecate this
// There should only be one of these per application
// This is due to restrictions by being cross platform
// some toolkit's on some operating systems don't support more than one
// Keep things simple. Do the default expected thing whenever possible
func New() *Node {
- /*
- if argGui.GuiStdout {
- log.Log(WARN, "--gui-stdout doesn't work yet")
- // trapStdout()
- }
- */
- if argGui.GuiPluginHack != "" {
- // does os.Exec() and does not return
- TestPluginAndExit()
- }
-
- if argGui.GuiVerbose {
- INFO.SetBool(true)
- }
-
initNew()
return me.rootNode
}
func PreInit(postMustParse func(string) string) *Node {
initNew()
+ /*
+ if argGui.GuiVerbose {
+ INFO.SetBool(true)
+ }
+ */
me.postMustParse = postMustParse
return me.rootNode
}
-func NoGui() bool {
- return argGui.NoGui
-}
-
+// deprecate this
// try to load andlabs, if that doesn't work, fall back to the console
func (n *Node) Default() (string, error) {
var err error
- // used to check if plugins load or not
- if argGui.GuiPluginHack != "" {
- // does os.Exec() and does not return
- TestPluginAndExit()
- os.Exit(0)
- }
+ /*
+ // used to check if plugins load or not
+ if argGui.GuiPluginHack != "" {
+ // does os.Exec() and does not return
+ TestPluginAndExit()
+ os.Exit(0)
+ }
+ */
- if argGui.NoGui {
- log.Log(WARN, "--no-gui chill Winston. I don't need no gui")
- return "", nil
- }
if argGui.GuiPlugin != "" {
log.Log(WARN, "New.Default() try toolkit =", argGui.GuiPlugin)
if n, err = n.LoadToolkit(argGui.GuiPlugin); err == nil {