more sendAction() cleanups
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
d9f9b3c688
commit
761250d24c
2
box.go
2
box.go
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
2
grid.go
2
grid.go
|
@ -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
|
||||
}
|
||||
|
|
2
group.go
2
group.go
|
@ -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
|
||||
|
|
2
image.go
2
image.go
|
@ -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
|
||||
}
|
||||
|
|
2
label.go
2
label.go
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
2
tab.go
|
@ -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
|
||||
|
|
|
@ -10,6 +10,6 @@ func (parent *Node) NewTextbox(name string) *Node {
|
|||
})
|
||||
|
||||
a := newAction(newNode, toolkit.Add)
|
||||
sendAction(a, newNode, parent)
|
||||
sendAction(a)
|
||||
return newNode
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue