summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--argv.go26
-rw-r--r--init.go55
-rw-r--r--pluginCheck.go18
3 files changed, 40 insertions, 59 deletions
diff --git a/argv.go b/argv.go
index 8637176..2bcbf4e 100644
--- a/argv.go
+++ b/argv.go
@@ -1,8 +1,6 @@
package gui
-import (
- "go.wit.com/dev/alexflint/arg"
-)
+import "go.wit.com/dev/alexflint/arg"
var argGui ArgsGui
@@ -11,12 +9,11 @@ This struct can be used with the go-arg package. These
are the generic default command line arguments for the 'GUI' package
*/
type ArgsGui struct {
- NoGui bool `arg:"--no-gui" help:"ignore all these gui problems"`
- GuiPlugin string `arg:"--gui" help:"Use this gui toolkit [andlabs,gocui,nocui,stdin]"`
- GuiFile string `arg:"--gui-file" help:"Use a specific plugin.so file"`
- GuiBuild bool `arg:"--gui-build" help:"attempt to build the GUI plugins"`
- GuiVerbose bool `arg:"--gui-verbose" help:"enable all logging"`
- GuiPluginHack string `arg:"--gui-check-plugin" help:"hack to verify GO plugins load"`
+ // NoGui bool `arg:"--no-gui" help:"ignore all these gui problems"`
+ GuiPlugin string `arg:"--gui" help:"Use this gui toolkit [andlabs,gocui,nocui,stdin]"`
+ GuiFile string `arg:"--gui-file" help:"Use a specific plugin.so file"`
+ // GuiBuild bool `arg:"--gui-build" help:"attempt to build the GUI plugins"`
+ // GuiVerbose bool `arg:"--gui-verbose" help:"enable all logging"`
}
/*
@@ -33,15 +30,4 @@ func ArgToolkit() string {
func InitArg() {
arg.Register(&argGui)
-
- if argGui.GuiPluginHack != "" {
- // does os.Exec() and does not return
- TestPluginAndExit()
- }
-}
-
-/*
-func init() {
- arg.Register(&argGui)
}
-*/
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 {
diff --git a/pluginCheck.go b/pluginCheck.go
index b0369b2..15f6660 100644
--- a/pluginCheck.go
+++ b/pluginCheck.go
@@ -61,10 +61,12 @@ func checkPluginCompatibility(pluginPath string) error {
}
func CheckPlugin() string {
- if argGui.GuiPluginHack != "" {
- // does os.Exec() and does not return
- TestPluginAndExit()
- }
+ /*
+ if argGui.GuiPluginHack != "" {
+ // does os.Exec() and does not return
+ TestPluginAndExit()
+ }
+ */
return "boo"
}
@@ -118,9 +120,11 @@ func checkPluginViaSubprocess(path string) error {
// retuns true if
func IsGoPluginTestHack() bool {
- if argGui.GuiPluginHack == "" {
- return false
- }
+ /*
+ if argGui.GuiPluginHack == "" {
+ return false
+ }
+ */
return true
}