add debugWindow()
This commit is contained in:
parent
83e9787e75
commit
07f6b7842e
17
debug.go
17
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
|
// a standard function to print out information about a widget
|
||||||
func (tk *guiWidget) dumpWidget(s string) {
|
func (tk *guiWidget) dumpWidget(s string) {
|
||||||
var s1 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 {
|
func printWidgetPlacements(g *gocui.Gui, v *gocui.View) error {
|
||||||
w := me.treeRoot.TK.(*guiWidget)
|
w := me.treeRoot.TK.(*guiWidget)
|
||||||
w.dumpTree("MM")
|
w.dumpTree("MM")
|
||||||
|
w.dumpWindows("WW")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue