diff options
Diffstat (limited to 'window.go')
| -rw-r--r-- | window.go | 41 |
1 files changed, 32 insertions, 9 deletions
@@ -18,10 +18,8 @@ func (parent *Node) NewWindow(title string) *Node { newNode.progname = title newNode.value = title - if ! newNode.hidden { - a := newAction(newNode, widget.Add) - sendAction(a) - } + // inform the toolkits + sendAction(newNode, widget.Add) return newNode } @@ -40,26 +38,51 @@ func (parent *Node) RawWindow(title string) *Node { // TODO: should do this recursively func (n *Node) UnDraw() *Node { - if ! n.hidden { - n.Hide() - } + if ! n.Ready() { return n } + n.hidden = true + n.changed = true + + // inform the toolkits + sendAction(n, widget.Delete) return n } // TODO: should do this recursively func (n *Node) Draw() *Node { + if ! n.Ready() { return n } + n.hidden = false + n.changed= true - a := newAction(n, widget.Add) - sendAction(a) + // inform the toolkits + sendAction(n, widget.Add) return n } // if the toolkit supports a gui with pixels, it might honor this. no promises // consider this a 'recommendation' or developer 'preference' to the toolkit +/* func (n *Node) PixelSize(w, h int) *Node { n.width = w n.height = w return n } +*/ + +func (n *Node) TestDraw() { + if (n == nil) { + return + } + + // enable and + n.hidden = false + n.changed = true + log.Warn("TestDraw() sending widget.Add", n.id, n.WidgetType, n.progname) + sendAction(n, widget.Add) + + for _, child := range n.children { + child.TestDraw() + } + return +} |
