action channel deprecated
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
8f937c19ee
commit
0f178bfaed
7
init.go
7
init.go
|
@ -10,6 +10,7 @@ import (
|
||||||
|
|
||||||
var muAction sync.Mutex
|
var muAction sync.Mutex
|
||||||
|
|
||||||
|
// TODO: add checks for nil function pointers
|
||||||
func (me *TreeInfo) newAction(a widget.Action) {
|
func (me *TreeInfo) newAction(a widget.Action) {
|
||||||
n := me.treeRoot.FindWidgetId(a.WidgetId)
|
n := me.treeRoot.FindWidgetId(a.WidgetId)
|
||||||
switch a.ActionType {
|
switch a.ActionType {
|
||||||
|
@ -60,12 +61,12 @@ func (me *TreeInfo) catchActionChannel() {
|
||||||
case a := <-me.pluginChan:
|
case a := <-me.pluginChan:
|
||||||
log.Verbose("catchActionChannel() on ", a.WidgetId, a.WidgetType, a.ProgName)
|
log.Verbose("catchActionChannel() on ", a.WidgetId, a.WidgetType, a.ProgName)
|
||||||
muAction.Lock()
|
muAction.Lock()
|
||||||
if me.ActionFromChannel == nil {
|
if me.newAction == nil {
|
||||||
log.Error(errors.New("toolkit ActionFromChannel == nil"), a.WidgetId, a.ActionType, a.WidgetType)
|
log.Error(errors.New("toolkit newAction == nil"), a.WidgetId, a.ActionType, a.WidgetType)
|
||||||
} else {
|
} else {
|
||||||
// send this to the toolkit
|
// send this to the toolkit
|
||||||
me.newAction(a)
|
me.newAction(a)
|
||||||
me.ActionFromChannel(a)
|
// me.ActionFromChannel(a)
|
||||||
}
|
}
|
||||||
muAction.Unlock()
|
muAction.Unlock()
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ type TreeInfo struct {
|
||||||
treeRoot *Node
|
treeRoot *Node
|
||||||
// NodeI interface{}
|
// NodeI interface{}
|
||||||
|
|
||||||
ActionFromChannel func(widget.Action)
|
// ActionFromChannel func(widget.Action)
|
||||||
NodeAction func(*Node, widget.ActionType)
|
NodeAction func(*Node, widget.ActionType)
|
||||||
Add func(*Node)
|
Add func(*Node)
|
||||||
AddText func(*Node, string)
|
AddText func(*Node, string)
|
||||||
|
|
Loading…
Reference in New Issue