summaryrefslogtreecommitdiff
path: root/debug.go
diff options
context:
space:
mode:
Diffstat (limited to 'debug.go')
-rw-r--r--debug.go30
1 files changed, 28 insertions, 2 deletions
diff --git a/debug.go b/debug.go
index 86c71a4..c4bd911 100644
--- a/debug.go
+++ b/debug.go
@@ -6,6 +6,7 @@ package main
import (
"fmt"
+ "github.com/awesome-gocui/gocui"
"go.wit.com/log"
"go.wit.com/widget"
)
@@ -29,7 +30,7 @@ func (tk *guiWidget) dumpWidget(s string) {
var pId int
// tk.verifyRect()
if tk.node.Parent == nil {
- log.Log(INFO, "showWidgetPlacement() parent == nil", tk.node.WidgetId, tk.cuiName)
+ log.Logf(WARN, "showWidgetPlacement() parent == nil wId=%d cuiName=%s", tk.node.WidgetId, tk.cuiName)
pId = 0
} else {
pId = tk.node.Parent.WidgetId
@@ -63,5 +64,30 @@ func (tk *guiWidget) dumpWidget(s string) {
}
end = fmt.Sprintf("%5s %-8s %s", tk.cuiName, tk.node.WidgetType, tk.String())
}
- log.Log(NOW, s1, s, end)
+ log.Log(GOCUI, s1, s, end)
+}
+
+func printWidgetTree(g *gocui.Gui, v *gocui.View) error {
+ me.treeRoot.ListWidgets()
+
+ tk := me.logStdout
+ // msg := fmt.Sprintf("test out kb %d\n", ecount)
+ // tk.Write([]byte(msg))
+ if tk == nil {
+ log.Log(ERROR, "tk = nil")
+ }
+ if tk.v == nil {
+ log.Log(ERROR, "tk.v = nil")
+ } else {
+ log.Log(ERROR, "setting log.CaptureMode(tk.v)")
+ log.Log(ERROR, "setting log.CaptureMode(tk.v)")
+ log.CaptureMode(tk)
+ }
+ return nil
+}
+
+func printWidgetPlacements(g *gocui.Gui, v *gocui.View) error {
+ w := me.treeRoot.TK.(*guiWidget)
+ w.dumpTree("MM")
+ return nil
}