diff options
Diffstat (limited to 'draw.go')
| -rw-r--r-- | draw.go | 38 |
1 files changed, 38 insertions, 0 deletions
@@ -0,0 +1,38 @@ +package main + +var toggle bool = true + +func (w *guiWidget) DrawAt(offsetW, offsetH int) { + w.setColor(&colorActiveW) + w.placeWidgets(offsetW, offsetH) // compute the sizes & places for each widget + w.active = false + w.showWidgets() +} + +func (w *guiWidget) toggleTree() { + if toggle { + w.drawTree(toggle) + toggle = false + } else { + w.hideWidgets() + toggle = true + } +} + +// display the widgets in the binary tree +func (w *guiWidget) drawTree(draw bool) { + if w == nil { + return + } + w.showWidgetPlacement("drawTree()") + if draw { + // w.textResize() + w.showView() + } else { + w.deleteView() + } + + for _, child := range w.children { + child.drawTree(draw) + } +} |
