diff options
| author | Jeff Carr <[email protected]> | 2023-03-03 14:41:38 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2023-03-03 14:41:38 -0600 |
| commit | 49202eeafdad8e5780fefdad3d2f87fd4354725e (patch) | |
| tree | 5d749b5d4835c7a0395bd1f87b5d2d1d91b14a08 /debug.go | |
| parent | 80317ec89c94beadcbf3775f84c6010b5ceef302 (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 'debug.go')
| -rw-r--r-- | debug.go | 80 |
1 files changed, 29 insertions, 51 deletions
@@ -10,69 +10,60 @@ import ( // various debugging flags var debugGui bool = false +var debugError bool = false var debugDump bool = false var debugNode bool = false var debugTabs bool = false +var debugFlags bool = false var debugChange bool = false // shows user events like mouse and keyboard var debugPlugin bool = false var debugToolkit bool = false -// func GetDebug () bool { -// return debugGui -// } +// for printing out the binary tree +var listChildrenParent *Node +var listChildrenDepth int = 0 +var defaultPadding = " " func SetDebug (s bool) { debugGui = s - debugChange = s debugDump = s debugTabs = s debugPlugin = s debugNode = s debugToolkit = s - SetDebugChange(s) - SetDebugToolkit(s) -} -/* -func GetDebugToolkit () bool { - return debugToolkit + SetFlag("Flags", s) + SetFlag("Toolkit", s) + SetFlag("Change", s) + SetFlag("Error", s) } -*/ -// This passes the debugToolkit flag to the toolkit plugin -func SetDebugToolkit (s bool) { - debugToolkit = s - for _, aplug := range allPlugins { - log(debugPlugin, "gui.SetDebugToolkit() aplug =", aplug.name) - if (aplug.SetDebugToolkit == nil) { - log(debugPlugin, "\tgui.SetDebugToolkit() = nil", aplug.name) - continue - } - aplug.SetDebugToolkit(s) - return +func SetFlag (s string, b bool) { + switch s { + case "Error": + debugError = b + case "Change": + debugChange = b + case "Show": + // print them here? For now, just used to print settings in the plugins + default: + log(debugError, "Can't set unknown flag", s) } - log(debugPlugin, "\tgui.SetDebugToolkit() = nil in all plugins") -} -// This passes the debugChange flag to the toolkit plugin -func SetDebugChange (s bool) { - // debugToolkit = s - for _, aplug := range allPlugins { - log(debugPlugin, "gui.SetDebugChange() aplug =", aplug.name) - if (aplug.SetDebugChange == nil) { - log(debugPlugin, "\tgui.SetDebugChange() = nil", aplug.name) - continue - } - aplug.SetDebugChange(s) - return - } - log(debugPlugin, "\tgui.SetDebugChange() = nil in all plugins") + // send the flag to the toolkit + n := Config.flag + log(debugChange, "Set() toolkit flag", s, "to", b) + n.widget.Action = "Set" + n.widget.S = s + n.widget.B = b + send(nil, n) } func ShowDebugValues() { // The order here should match the order in the GUI // TODO: get the order from the node binary tree log(true, "Debug =", debugGui) + log(true, "DebugError =", debugError) log(true, "DebugChange =", debugChange) log(true, "DebugDump =", debugDump) log(true, "DebugTabs =", debugTabs) @@ -80,16 +71,7 @@ func ShowDebugValues() { log(true, "DebugNode =", debugNode) log(true, "DebugToolkit =", debugToolkit) - // dump out the debugging flags for the plugins - for _, aplug := range allPlugins { - log(debugPlugin, "gui.ShowDebug() aplug =", aplug.name) - if (aplug.ShowDebug == nil) { - log(debugPlugin, "\tgui.ShowDebug() = nil", aplug.name) - continue - } - aplug.ShowDebug() - return - } + SetFlag("Show", true) } func (n *Node) Dump() { @@ -116,10 +98,6 @@ func (n *Node) Dump() { Indent("NODE DUMP END") } -var listChildrenParent *Node -var listChildrenDepth int = 0 -var defaultPadding = " " - func Indent(a ...interface{}) { logindent(listChildrenDepth, defaultPadding, a...) } |
