summaryrefslogtreecommitdiff
path: root/debugFlags.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-03-03 14:41:38 -0600
committerJeff Carr <[email protected]>2023-03-03 14:41:38 -0600
commit49202eeafdad8e5780fefdad3d2f87fd4354725e (patch)
tree5d749b5d4835c7a0395bd1f87b5d2d1d91b14a08 /debugFlags.go
parent80317ec89c94beadcbf3775f84c6010b5ceef302 (diff)
release as v0.6.5v0.6.5
good standard release really clean interaction to plugin really clean debug flags implementation common doAppend() idea, but it probably won't work re-implement combobox. this code base almost doesn't suck slider & spinner set values now tab set margin works convert dropdown to Send() lots of other changes to try to implement single line Entry() I guess use golang file names even though internalally the go developers use underscore chars in the actual go sources. Maybe there is a reason for that? go channel debug window does something make a debug window for channels. add sample icons Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'debugFlags.go')
-rw-r--r--debugFlags.go92
1 files changed, 92 insertions, 0 deletions
diff --git a/debugFlags.go b/debugFlags.go
new file mode 100644
index 0000000..08aa766
--- /dev/null
+++ b/debugFlags.go
@@ -0,0 +1,92 @@
+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("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)
+ }
+
+ // errors. by default these always output somewhere
+ cbE := g.NewCheckbox("debugError")
+ cbE.Custom = func() {
+ debugError = cbE.widget.B
+ SetFlag("Error", debugError)
+ }
+
+ // 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
+ SetFlag("Change", debugChange)
+ 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)
+ SetFlag("Toolkit", cb7.widget.B)
+ log(debugFlags, "Custom() n.widget =", cb7.widget.Name, cb7.widget.B)
+ }
+
+ g.NewButton("Dump Debug Flags", func () {
+ ShowDebugValues()
+ })
+}