tree starts to work. 'M' lists internal gocui tree
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
4fbbd2cee1
commit
1f3d664dbd
15
widget.go
15
widget.go
|
@ -29,6 +29,21 @@ func initWidget(n *tree.Node) *guiWidget {
|
||||||
w.heights = make(map[int]int) // how wide each column in the grid is
|
w.heights = make(map[int]int) // how wide each column in the grid is
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p := n.Parent
|
||||||
|
if p == nil {
|
||||||
|
log.Log(ERROR, "parent == nil", w.String(), n.WidgetId, w.WidgetType)
|
||||||
|
return w
|
||||||
|
}
|
||||||
|
if p.TK == nil {
|
||||||
|
log.Log(ERROR, "parent.TK == nil", w.String(), n.WidgetId, w.WidgetType)
|
||||||
|
return w
|
||||||
|
}
|
||||||
|
|
||||||
|
// set the parent and append to parent children
|
||||||
|
var ptk *guiWidget
|
||||||
|
ptk = p.TK.(*guiWidget)
|
||||||
|
w.parent = ptk
|
||||||
|
ptk.children = append(ptk.children, w)
|
||||||
return w
|
return w
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue