summaryrefslogtreecommitdiff
path: root/debug.go
diff options
context:
space:
mode:
Diffstat (limited to 'debug.go')
-rw-r--r--debug.go21
1 files changed, 20 insertions, 1 deletions
diff --git a/debug.go b/debug.go
index 86fa7ce..b89aa80 100644
--- a/debug.go
+++ b/debug.go
@@ -1,6 +1,8 @@
package tree
import (
+ "fmt"
+
"go.wit.com/log"
"go.wit.com/widget"
)
@@ -20,7 +22,24 @@ func (n *Node) ShowButtons() {
}
func (n *Node) DumpWidget(pad string) {
- log.Log(TREEWARN, "node:", pad, n.WidgetId, ",", n.WidgetType, ",", n.GetProgName())
+ s := n.GetProgName()
+ if s == "" {
+ s = n.CurrentS()
+ }
+ if s == "" {
+ s = n.String()
+ }
+ if s == "" {
+ s = n.ProgName()
+ }
+ if s == "" {
+ s = n.GetLabel()
+ }
+ if s == "" {
+ s = n.State.NewString
+ }
+ end := fmt.Sprintf("%d,%-9s .%s.", n.WidgetId, n.WidgetType, s)
+ log.Log(TREEWARN, "node:", pad, end)
}
var depth int = 0