blob: 64883eeda8d5bb5e753b4885d5705c42e319e7f7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
package tree
import (
"go.wit.com/log"
"go.wit.com/lib/widget"
)
func (n *Node) ShowButtons() {
if n.WidgetType == widget.Button {
n.DumpWidget("Button:")
}
for _, child := range n.children {
child.ShowButtons()
}
}
func (n *Node) DumpWidget(pad string) {
log.Warn("node:", pad, n.WidgetId, ",", n.WidgetType, ",", n.GetProgName())
}
var depth int = 0
func (n *Node) ListWidgets() {
if (n == nil) {
log.Warn("ERRRORRRR: n == nil in ListWidgets()")
log.Warn("ERRRORRRR: n == nil in ListWidgets()")
log.Warn("ERRRORRRR: n == nil in ListWidgets()")
return
}
var pad string
for i := 0; i < depth; i++ {
pad = pad + " "
}
n.DumpWidget(pad)
for _, child := range n.children {
depth += 1
child.ListWidgets()
depth -= 1
}
return
}
|