diff options
| author | Jeff Carr <[email protected]> | 2024-01-06 13:53:15 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-06 13:53:15 -0600 |
| commit | b3dfc689abe6699112518ddaf5e12aa87ef931f8 (patch) | |
| tree | 2f5e14ac484ac45e52e58a57dd95f904a0d38094 /window.go | |
| parent | d075b29aff66e784a615a0a3e436ae7433556789 (diff) | |
sierpinski carpet mode
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'window.go')
| -rw-r--r-- | window.go | 45 |
1 files changed, 43 insertions, 2 deletions
@@ -16,7 +16,48 @@ func (parent *Node) NewWindow(title string) *Node { log.Info("NewWindow()", title) - a := newAction(newNode, widget.Add) - sendAction(a) + if ! newNode.hidden { + a := newAction(newNode, widget.Add) + sendAction(a) + } + return newNode +} + +// allow window create without actually sending it to the toolkit +func (parent *Node) RawWindow(title string) *Node { + var newNode *Node + + // Windows are created off of the master node of the Binary Tree + newNode = parent.newNode(title, widget.Window) + newNode.Custom = StandardExit + newNode.hidden = true + + log.Info("RawWindow()", title) return newNode } + +// TODO: should do this recursively +func (n *Node) UnDraw() *Node { + if ! n.hidden { + n.Hide() + } + n.hidden = true + return n +} + +// TODO: should do this recursively +func (n *Node) Draw() *Node { + n.hidden = false + + a := newAction(n, widget.Add) + sendAction(a) + 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 +} |
