summaryrefslogtreecommitdiff
path: root/treeDraw.go
diff options
context:
space:
mode:
Diffstat (limited to 'treeDraw.go')
-rw-r--r--treeDraw.go42
1 files changed, 41 insertions, 1 deletions
diff --git a/treeDraw.go b/treeDraw.go
index 39db38d..9f71eb2 100644
--- a/treeDraw.go
+++ b/treeDraw.go
@@ -101,7 +101,7 @@ 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.dumpWidget("DrawAt()")
+ w.dumpWidget(fmt.Sprintf("DrawAt(%d,%d)", offsetW, offsetH))
}
func (w *guiWidget) simpleDrawAt(offsetW, offsetH int) {
@@ -139,3 +139,43 @@ func (w *guiWidget) drawTree(draw bool) {
child.drawTree(draw)
}
}
+
+func (w *guiWidget) Show() {
+ // don't display fake widgets
+ if w.isFake {
+ return
+ }
+
+ // deprecate this
+ // if this isn't in the binary tree
+ // it's some internal widget so always display those
+ if w.node == nil {
+ w.drawView()
+ return
+ }
+
+ // deprecate this
+ // always show window titles
+ if w.node.WidgetType == widget.Window {
+ w.drawView()
+ return
+ }
+
+ /*
+ // if the widget is not in the current displayed windo
+ if !w.IsCurrent() {
+ // log.Log(GOCUI, "Show() w.IsCurrent == false. NOT drawing", w.cuiName, w.String())
+ return
+ }
+ */
+
+ // this comes from the application developer
+ // finally, check if the widget State is hidden or not
+ if w.node.Hidden() {
+ // log.Log(GOCUI, "Show() w.node.Hidden() = false. not drawing", w.cuiName, w.String())
+ // don't display hidden widgets
+ return
+ }
+ // log.Log(GOCUI, "Show() doing w.drawView()", w.cuiName, w.String())
+ w.drawView()
+}