summaryrefslogtreecommitdiff
path: root/window.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-05-09 18:50:16 -0500
committerJeff Carr <[email protected]>2023-05-09 18:50:16 -0500
commitc36725fa90acc47fe5c0650f93540b5d65a126b6 (patch)
tree287e41eecaa606aa0714e6e2126327c8aa83aa14 /window.go
parentb392c40969e105b00efa262042d647303d6fbc2c (diff)
simplify sendAction()
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'window.go')
-rw-r--r--window.go14
1 files changed, 4 insertions, 10 deletions
diff --git a/window.go b/window.go
index db254d4..09265d1 100644
--- a/window.go
+++ b/window.go
@@ -6,21 +6,15 @@ import (
// This routine creates a blank window with a Title and size (W x H)
-func (n *Node) NewWindow(title string) *Node {
+func (parent *Node) NewWindow(title string) *Node {
var newNode *Node
// Windows are created off of the master node of the Binary Tree
- newNode = n.newNode(title, toolkit.Window, StandardExit)
+ newNode = parent.newNode(title, toolkit.Window, StandardExit)
log(logInfo, "NewWindow()", title)
- var a toolkit.Action
- a.ActionType = toolkit.Add
- a.X = n.X
- a.Y = n.Y
- a.Name = title
- a.Text = title
- newaction(&a, newNode, n)
-
+ a := newAction(newNode, toolkit.Add)
+ sendAction(a, newNode, parent)
return newNode
}