summaryrefslogtreecommitdiff
path: root/debug_flags.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-03-01 11:35:36 -0600
committerJeff Carr <[email protected]>2023-03-01 11:35:36 -0600
commit8dbf5a09097b7868e9218bf98716c57eac998a10 (patch)
treeab3bdfeaf5a59a55de9d2a6661d2d824090491e5 /debug_flags.go
parentf3bb68396afa7452ecf1c8d4744c825a9d81057c (diff)
lots cleaner code between the pluginv0.6.1
Queue() around SetText is helping userspace crashing merge forceDump(bool) into Dump() debugging output configuration is pretty clean keep cutting down duplicate things --gui-verbose flag works make label "standard" code add debug.FreeOSMemory() move the GO language internals to display in the GUI update push to do tags and go to github.com/wit-go/ remove the other license file it might be confusing golang.org and github proper WidgetType added a Quit() button Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'debug_flags.go')
-rw-r--r--debug_flags.go84
1 files changed, 84 insertions, 0 deletions
diff --git a/debug_flags.go b/debug_flags.go
new file mode 100644
index 0000000..ea535c4
--- /dev/null
+++ b/debug_flags.go
@@ -0,0 +1,84 @@
+package gui
+
+// Let's you toggle on and off the various types of debugging output
+// These checkboxes should be in the same order as the are printed
+func (n *Node) debugFlags(makeWindow bool) {
+ var w, g *Node
+
+ // Either:
+ // make a new window
+ // make a new tab in the existing window
+ if (makeWindow) {
+ Config.Title = "Debug Flags"
+ Config.Width = 300
+ Config.Height = 400
+ w = NewWindow()
+ w.Custom = w.StandardClose
+ } else {
+ w = n.NewTab("Debug Flags")
+ }
+ w.Dump()
+
+ g = w.NewGroup("Debug Flags")
+
+ g.NewButton("Turn on all Debug Flags", func () {
+ SetDebug(true)
+ })
+
+ g.NewButton("Turn off all Debug Flags", func () {
+ SetDebug(false)
+ })
+
+ // generally useful debugging
+ cb1 := g.NewCheckbox("debugGui")
+ cb1.Custom = func() {
+ debugGui = cb1.widget.B
+ log(debugGui, "Custom() n.widget =", cb1.widget.Name, cb1.widget.B)
+ }
+
+ // debugging that will show you things like mouse clicks, user inputing text, etc
+ // also set toolkit.DebugChange
+ cb2 := g.NewCheckbox("debugChange")
+ cb2.Custom = func() {
+ debugChange = cb2.widget.B
+ SetDebugChange(cb2.widget.B)
+ log(debugGui, "Custom() n.widget =", cb2.widget.Name, cb2.widget.B)
+ }
+
+ // supposed to tell if you are going to dump full variable output
+ cb3 := g.NewCheckbox("debugDump")
+ cb3.Custom = func() {
+ debugDump = cb3.widget.B
+ log(debugGui, "Custom() n.widget =", cb3.widget.Name, cb3.widget.B)
+ }
+
+ cb4 := g.NewCheckbox("debugTabs")
+ cb4.Custom = func() {
+ debugTabs = cb4.widget.B
+ log(debugGui, "Custom() n.widget =", cb4.widget.Name, cb4.widget.B)
+ }
+
+ // should show you when things go into or come back from the plugin
+ cb5 := g.NewCheckbox("debugPlugin")
+ cb5.Custom = func() {
+ debugPlugin = cb5.widget.B
+ log(debugGui, "Custom() n.widget =", cb5.widget.Name, cb5.widget.B)
+ }
+
+ cb6 := g.NewCheckbox("debugNode")
+ cb6.Custom = func() {
+ debugNode = cb6.widget.B
+ log(debugGui, "Custom() n.widget =", cb6.widget.Name, cb6.widget.B)
+ }
+
+ // turns on debugging inside the plugin toolkit
+ cb7 := g.NewCheckbox("debugToolkit")
+ cb7.Custom = func() {
+ SetDebugToolkit(cb7.widget.B)
+ log(debugGui, "Custom() n.widget =", cb7.widget.Name, cb7.widget.B)
+ }
+
+ g.NewButton("Dump Debug Flags", func () {
+ ShowDebugValues()
+ })
+}