summaryrefslogtreecommitdiff
path: root/image.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 /image.go
parentb392c40969e105b00efa262042d647303d6fbc2c (diff)
simplify sendAction()
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'image.go')
-rw-r--r--image.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/image.go b/image.go
index c764eff..4531f23 100644
--- a/image.go
+++ b/image.go
@@ -4,13 +4,11 @@ import (
"git.wit.org/wit/gui/toolkit"
)
-func (n *Node) NewImage(name string) *Node {
+func (parent *Node) NewImage(name string) *Node {
var newNode *Node
- newNode = n.newNode(name, toolkit.Image, nil)
-
- var a toolkit.Action
- a.ActionType = toolkit.Add
- newaction(&a, newNode, n)
+ newNode = parent.newNode(name, toolkit.Image, nil)
+ a := newAction(newNode, toolkit.Add)
+ sendAction(a, newNode, parent)
return newNode
}