diff options
| author | Jeff Carr <[email protected]> | 2025-02-05 07:24:14 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-02-05 07:24:14 -0600 |
| commit | 12f3d5ac5cb4add74eb9a053ae1804c661654d09 (patch) | |
| tree | c70342cf9b59ef9d26493171a52a79df9d660eb1 /debug.go | |
| parent | a81e931b9ac830f7812d696e0ecc182fb3a00b7f (diff) | |
set the node.State.Label on SetText()
Diffstat (limited to 'debug.go')
| -rw-r--r-- | debug.go | 30 |
1 files changed, 28 insertions, 2 deletions
@@ -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 } |
