parent
10ae244d5a
commit
c22fc7b602
21
event.go
21
event.go
|
@ -18,7 +18,7 @@ import (
|
||||||
|
|
||||||
func (me *TreeInfo) SendEnableDebugger() {
|
func (me *TreeInfo) SendEnableDebugger() {
|
||||||
if me.callback == nil {
|
if me.callback == nil {
|
||||||
log.Warn("SendUserEvent() toolkit panic() callback == nil")
|
log.Warn("SendEnableDebugger() callback == nil")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var a widget.Action
|
var a widget.Action
|
||||||
|
@ -30,44 +30,44 @@ func (me *TreeInfo) SendEnableDebugger() {
|
||||||
|
|
||||||
func (me *TreeInfo) SendToolkitLoad(s string) {
|
func (me *TreeInfo) SendToolkitLoad(s string) {
|
||||||
if me.callback == nil {
|
if me.callback == nil {
|
||||||
log.Warn("SendUserEvent() toolkit load callback == nil")
|
log.Warn("SendToolkitLoad() callback == nil")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var a widget.Action
|
var a widget.Action
|
||||||
a.ActionType = widget.ToolkitLoad
|
a.ActionType = widget.ToolkitLoad
|
||||||
a.ProgName = me.PluginName
|
a.ProgName = me.PluginName
|
||||||
a.Value = s
|
a.Value = s
|
||||||
log.Warn("SendUserEvent() START: toolkit load", s)
|
log.Warn("SendToolkitLoad() START: toolkit load", s)
|
||||||
me.callback <- a
|
me.callback <- a
|
||||||
log.Warn("SendUserEvent() END: toolkit load", s)
|
log.Warn("SendToolkitLoad() END: toolkit load", s)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (me *TreeInfo) SendToolkitPanic() {
|
func (me *TreeInfo) SendToolkitPanic() {
|
||||||
if me.callback == nil {
|
if me.callback == nil {
|
||||||
log.Warn("SendUserEvent() toolkit panic() callback == nil")
|
log.Warn("SendToolkitPanic() callback == nil")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var a widget.Action
|
var a widget.Action
|
||||||
a.ActionType = widget.ToolkitPanic
|
a.ActionType = widget.ToolkitPanic
|
||||||
a.ProgName = me.PluginName
|
a.ProgName = me.PluginName
|
||||||
log.Log(TREE, "SendUserEvent() START: toolkit panic()")
|
log.Log(TREE, "SendToolkitPanic() START")
|
||||||
me.callback <- a
|
me.callback <- a
|
||||||
log.Log(TREE, "SendUserEvent() END: toolkit panic()")
|
log.Log(TREE, "SendToolkitPanic() END")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (me *TreeInfo) SendWindowCloseEvent(n *Node) {
|
func (me *TreeInfo) SendWindowCloseEvent(n *Node) {
|
||||||
if me.callback == nil {
|
if me.callback == nil {
|
||||||
log.Warn("SendUserEvent() callback == nil", n.WidgetId)
|
log.Warn("SendWindowClose() callback == nil", n.WidgetId)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var a widget.Action
|
var a widget.Action
|
||||||
a.WidgetId = n.WidgetId
|
a.WidgetId = n.WidgetId
|
||||||
a.ActionType = widget.CloseWindow
|
a.ActionType = widget.CloseWindow
|
||||||
log.Log(TREE, "SendUserEvent() START: user closed the window", n.GetProgName())
|
log.Log(TREE, "SendWindowClose() START: user closed the window", n.GetProgName())
|
||||||
me.callback <- a
|
me.callback <- a
|
||||||
log.Log(TREE, "SendUserEvent() END: user closed the window", n.GetProgName())
|
log.Log(TREE, "SendWindowClose() END: user closed the window", n.GetProgName())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,6 +80,7 @@ func (me *TreeInfo) SendUserEvent(n *Node) {
|
||||||
var a widget.Action
|
var a widget.Action
|
||||||
a.WidgetId = n.WidgetId
|
a.WidgetId = n.WidgetId
|
||||||
a.Value = n.State.Value
|
a.Value = n.State.Value
|
||||||
|
a.State = n.State
|
||||||
a.ActionType = widget.User
|
a.ActionType = widget.User
|
||||||
if n.WidgetType == widget.Checkbox {
|
if n.WidgetType == widget.Checkbox {
|
||||||
log.Log(TREE, "SendUserEvent() checkbox going to send:", a.Value)
|
log.Log(TREE, "SendUserEvent() checkbox going to send:", a.Value)
|
||||||
|
|
Loading…
Reference in New Issue