more sendAction() cleanups

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2023-05-09 18:53:31 -05:00
parent d9f9b3c688
commit 761250d24c
14 changed files with 16 additions and 22 deletions

2
box.go
View File

@ -9,6 +9,6 @@ func (parent *Node) NewBox(name string, b bool) *Node {
newNode.B = b
a := newAction(newNode, toolkit.Add)
sendAction(a, newNode, parent)
sendAction(a)
return newNode
}

View File

@ -6,7 +6,7 @@ func (parent *Node) NewButton(name string, custom func()) *Node {
newNode := parent.newNode(name, toolkit.Button, custom)
a := newAction(newNode, toolkit.Add)
sendAction(a, newNode, parent)
sendAction(a)
return newNode
}

View File

@ -10,7 +10,6 @@ func (n *Node) NewCheckbox(name string) *Node {
newNode := n.newNode(name, toolkit.Checkbox, nil)
a := newAction(newNode, toolkit.Add)
sendAction(a, newNode, n)
sendAction(a)
return newNode
}

View File

@ -23,7 +23,7 @@ func (n *Node) NewDropdown(name string) *Node {
newNode := n.newNode(name, toolkit.Dropdown, nil)
a := newAction(newNode, toolkit.Add)
sendAction(a, newNode, n)
sendAction(a)
return newNode
}
@ -32,7 +32,7 @@ func (n *Node) NewCombobox(name string) *Node {
newNode := n.newNode(name, toolkit.Combobox, nil)
a := newAction(newNode, toolkit.Add)
sendAction(a, newNode, n)
sendAction(a)
return newNode
}

View File

@ -36,7 +36,7 @@ func (n *Node) NewGrid(name string, w int, h int) *Node {
newNode.NextW = 1
newNode.NextH = 1
sendAction(a, newNode, n)
sendAction(a)
return newNode
}

View File

@ -12,7 +12,7 @@ func (parent *Node) NewGroup(name string) *Node {
newNode = parent.newNode(name, toolkit.Group, nil)
a := newAction(newNode, toolkit.Add)
sendAction(a, newNode, parent)
sendAction(a)
newBox := newNode.NewBox("defaultGroupBox", false)
return newBox

View File

@ -9,6 +9,6 @@ func (parent *Node) NewImage(name string) *Node {
newNode = parent.newNode(name, toolkit.Image, nil)
a := newAction(newNode, toolkit.Add)
sendAction(a, newNode, parent)
sendAction(a)
return newNode
}

View File

@ -7,6 +7,6 @@ import (
func (parent *Node) NewLabel(text string) *Node {
newNode := parent.newNode(text, toolkit.Label, nil)
a := newAction(newNode, toolkit.Add)
sendAction(a, newNode, parent)
sendAction(a)
return newNode
}

View File

@ -222,9 +222,7 @@ func newAction(n *Node, atype toolkit.ActionType) *toolkit.Action {
return &a
}
// func sendAction(a *toolkit.Action) {
func sendAction(a *toolkit.Action, n *Node, where *Node) {
// newaction(a, n, where)
func sendAction(a *toolkit.Action) {
for _, aplug := range allPlugins {
log(debugPlugin, "Action() aplug =", aplug.name, "Action type=", a.ActionType)
if (aplug.pluginChan == nil) {

View File

@ -14,7 +14,7 @@ func (parent *Node) NewSlider(name string, x int, y int) *Node {
a := newAction(newNode, toolkit.Add)
a.X = x
a.Y = y
sendAction(a, newNode, parent)
sendAction(a)
return newNode
}

View File

@ -11,11 +11,8 @@ func (parent *Node) NewSpinner(name string, x int, y int) *Node {
newNode.X = x
newNode.Y = y
a := newAction(newNode, toolkit.Add)
a.X = x
a.Y = y
sendAction(a, newNode, parent)
sendAction(a)
return newNode
}

2
tab.go
View File

@ -31,7 +31,7 @@ func (n *Node) NewTab(text string) *Node {
newNode := n.newNode(text, toolkit.Tab, nil)
a := newAction(newNode, toolkit.Add)
sendAction(a, newNode, n)
sendAction(a)
// by default, create a box inside the tab
// TODO: allow this to be configurable

View File

@ -10,6 +10,6 @@ func (parent *Node) NewTextbox(name string) *Node {
})
a := newAction(newNode, toolkit.Add)
sendAction(a, newNode, parent)
sendAction(a)
return newNode
}

View File

@ -15,6 +15,6 @@ func (parent *Node) NewWindow(title string) *Node {
log(logInfo, "NewWindow()", title)
a := newAction(newNode, toolkit.Add)
sendAction(a, newNode, parent)
sendAction(a)
return newNode
}