summaryrefslogtreecommitdiff
path: root/debug.go
diff options
context:
space:
mode:
Diffstat (limited to 'debug.go')
-rw-r--r--debug.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/debug.go b/debug.go
index c4bd911..ff78f93 100644
--- a/debug.go
+++ b/debug.go
@@ -24,6 +24,22 @@ func (w *guiWidget) dumpTree(s string) {
}
}
+func (w *guiWidget) dumpWindows(s string) {
+ // log.Log(ERROR, "dump w", w.node.WidgetId, w.WidgetType, w.String())
+ if w == nil {
+ log.Log(ERROR, "dump w.TK == nil", w.node.WidgetId, w.node.WidgetType, w.String())
+ return
+ }
+ s += fmt.Sprintf("(%d,%d)", w.force.w0, w.force.h0)
+ if w.node.WidgetType == widget.Window {
+ w.dumpWidget("dumpWindow() " + s)
+ }
+
+ for _, child := range w.children {
+ child.dumpWindows(s)
+ }
+}
+
// a standard function to print out information about a widget
func (tk *guiWidget) dumpWidget(s string) {
var s1 string
@@ -89,5 +105,6 @@ func printWidgetTree(g *gocui.Gui, v *gocui.View) error {
func printWidgetPlacements(g *gocui.Gui, v *gocui.View) error {
w := me.treeRoot.TK.(*guiWidget)
w.dumpTree("MM")
+ w.dumpWindows("WW")
return nil
}