45 lines
800 B
Go
45 lines
800 B
Go
package tree
|
|
|
|
import (
|
|
"go.wit.com/log"
|
|
"go.wit.com/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.Log(TREEWARN, "node:", pad, n.WidgetId, ",", n.WidgetType, ",", n.GetProgName())
|
|
}
|
|
|
|
var depth int = 0
|
|
|
|
func (n *Node) ListWidgets() {
|
|
if n == nil {
|
|
log.Log(TREEWARN, "ERRRORRRR: n == nil in ListWidgets()")
|
|
log.Log(TREEWARN, "ERRRORRRR: n == nil in ListWidgets()")
|
|
log.Log(TREEWARN, "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
|
|
}
|