summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-12-29 17:51:42 -0600
committerJeff Carr <[email protected]>2023-12-29 17:51:42 -0600
commit25990de20d03ff852921c862c36bd5d4877c2bb1 (patch)
treef742604fa6205c907b87f4f6e226e5cc977aac1f
parentced398383ee30b7fab4ff9e71cfa9d0ad96705b5 (diff)
implement --gui-debug command line option
Signed-off-by: Jeff Carr <[email protected]>
-rw-r--r--main.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/main.go b/main.go
index b2054b9..3254d0a 100644
--- a/main.go
+++ b/main.go
@@ -2,6 +2,7 @@ package gui
import (
"os"
+ "time"
"go.wit.com/gui/toolkit"
)
@@ -123,6 +124,9 @@ func New() *Node {
// try to load andlabs, if that doesn't work, fall back to the console
func (n *Node) Default() *Node {
+ // start the GUI debugger if --gui-debug is true
+ checkDebug()
+
if (argGui.GuiPlugin != "") {
log(logError, "New.Default() try toolkit =", argGui.GuiPlugin)
return n.LoadToolkit(argGui.GuiPlugin)
@@ -142,6 +146,26 @@ func (n *Node) Default() *Node {
return n
}
+func checkDebug() {
+ if ! ArgDebug() {
+ return
+ }
+ f := func() {
+ log(debugGui, "wit/gui START DEBUG")
+ log(debugGui, "wit/gui START DEBUG")
+ log(debugGui, "wit/gui START DEBUG")
+ time.Sleep(2 * time.Second)
+ log(debugGui, "wit/gui START DEBUG")
+ log(debugGui, "wit/gui START DEBUG")
+ log(debugGui, "wit/gui START DEBUG")
+ DebugWindow()
+ log(debugGui, "wit/gui END DEBUG")
+ log(debugGui, "wit/gui END DEBUG")
+ log(debugGui, "wit/gui END DEBUG")
+ }
+ go f()
+}
+
// The window is destroyed but the application does not quit
func (n *Node) StandardClose() {
log(debugGui, "wit/gui Standard Window Close. name =", n.Name)