diff options
| author | Jeff Carr <[email protected]> | 2021-10-31 14:21:36 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2021-10-31 14:21:36 -0500 |
| commit | 213c7d153b06d3e1211d1cdeae1e4f7833cb89f7 (patch) | |
| tree | 53b489c9df4ea1784be0d626df1497b04183c9be /debug.go | |
| parent | 36e2c6d2e3c266f32325985e98c3776755fdd511 (diff) | |
REFACTOR: refactor everything to gui.Node structv0.2
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'debug.go')
| -rw-r--r-- | debug.go | 66 |
1 files changed, 59 insertions, 7 deletions
@@ -8,14 +8,13 @@ import ( "github.com/davecgh/go-spew/spew" ) -// import "reflect" - -// import "github.com/andlabs/ui" -// import _ "github.com/andlabs/ui/winmanifest" - -// -// Dump out debugging information every 4 seconds +// WatchGUI() opens a goroutine // +// From that goroutine, it dumps out debugging information every 4 seconds +/* + TODO: add configuration triggers on what to dump out + TODO: allow this to be sent to /var/log, syslogd, systemd's journalctl, etc +*/ func WatchGUI() { count := 0 @@ -32,6 +31,12 @@ func WatchGUI() { } } +func DumpWindows() { + for name, _ := range Data.WindowMap { + log.Println("gui.DumpWindows() window =", name) + } +} + func DumpMap() { for name, window := range Data.WindowMap { log.Println("gui.DumpBoxes() MAP: ", name) @@ -106,3 +111,50 @@ func addTableTab() { log.Println("Sleep for 1 second, then try to add new tabs") time.Sleep(1 * time.Second) } + +func (dn *GuiData) DumpNodeMap() { + log.Println("DebugDataNodeMap():") + for name, node := range dn.NodeMap { + log.Println("\tNode =", node.id, node.Width, node.Height, name) + if (node.children == nil) { + log.Println("\t\tNo children") + } else { + log.Println("\t\tHas children:", node.children) + } + // node.SetName("yahoo") + // log.Println("\tData.NodeMap node =", node) + } +} + +/* +func DebugDataNodeChildren() { + if Data.NodeMap == nil { + log.Println("DebugDataNodeChildren() NodeMap == nil") + return + } + log.Println("DebugDataNodeChildren():") + for name, node := range Data.NodeMap { + log.Println("\tNode name =", node.Width, node.Height, name) + if (node.children == nil) { + log.Println("\t\tNo children") + break + } + log.Println("\t\tHas children:", node.children) + } +} +*/ + +func (dn *GuiData) ListChildren(dump bool) { + if Data.NodeMap == nil { + log.Println("gui.Data.ListChildren() Data.NodeMap == nil") + return + } + log.Println("gui.Data.ListChildren() Data.NodeMap:") + for name, node := range Data.NodeMap { + log.Println("\tgui.Data.ListChildren() node =", node.id, node.Width, node.Height, name) + if (dump == true) { + node.Dump() + } + node.ListChildren(dump) + } +} |
