finally add a ToolkitInit()
This commit is contained in:
parent
3fb1d3ef70
commit
1e97138a1c
21
action.go
21
action.go
|
@ -12,11 +12,26 @@ import (
|
||||||
|
|
||||||
// everything from the application goes through here
|
// everything from the application goes through here
|
||||||
func (me *TreeInfo) doAction(a widget.Action) {
|
func (me *TreeInfo) doAction(a widget.Action) {
|
||||||
|
if a.ActionType == widget.ToolkitInit {
|
||||||
|
log.Log(TREEWARN, "tree.doAction() trapped ToolkitInit finally!")
|
||||||
|
if me.ToolkitInit != nil {
|
||||||
|
log.Log(TREEWARN, "tree.doAction() doing ToolkitInit()")
|
||||||
|
me.ToolkitInit()
|
||||||
|
} else {
|
||||||
|
log.Log(TREEWARN, "tree.doAction() me.ToolkitInit() == nil")
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
if a.TablePB != nil {
|
if a.TablePB != nil {
|
||||||
log.Log(TREEWARN, "tree: got a TablePB")
|
log.Log(TREEWARN, "tree: got a TablePB")
|
||||||
me.doTable(a)
|
me.doTable(a)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if a.WidgetId == 0 {
|
||||||
|
if treeRoot == nil {
|
||||||
|
log.Log(TREEWARN, "tree.doAction() yes, treeRoot is nil. add here")
|
||||||
|
}
|
||||||
|
}
|
||||||
n := treeRoot.FindWidgetId(a.WidgetId)
|
n := treeRoot.FindWidgetId(a.WidgetId)
|
||||||
switch a.ActionType {
|
switch a.ActionType {
|
||||||
case widget.Add:
|
case widget.Add:
|
||||||
|
@ -33,6 +48,12 @@ func (me *TreeInfo) doAction(a widget.Action) {
|
||||||
// log.Log(TREEWARN, "tree.FindWidgetId() n == nil", a.State.CurrentS)
|
// log.Log(TREEWARN, "tree.FindWidgetId() n == nil", a.State.CurrentS)
|
||||||
// log.Log(TREEWARN, "tree.FindWidgetId() n == nil. A bug in your application?")
|
// log.Log(TREEWARN, "tree.FindWidgetId() n == nil. A bug in your application?")
|
||||||
log.Log(TREEWARN, "tree.doAction() bug in gui. trying to do action", a.ActionType, "before widget init() wId =", a.WidgetId)
|
log.Log(TREEWARN, "tree.doAction() bug in gui. trying to do action", a.ActionType, "before widget init() wId =", a.WidgetId)
|
||||||
|
if a.WidgetId == 0 {
|
||||||
|
log.Log(TREEWARN, "tree.doAction() bug in gui. on wId zero. is treeRoot nil?")
|
||||||
|
if treeRoot == nil {
|
||||||
|
log.Log(TREEWARN, "tree.doAction() yes, treeRoot is nil")
|
||||||
|
}
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@ type TreeInfo struct {
|
||||||
SetTitle func(*Node, string) // update the title of a window or tab
|
SetTitle func(*Node, string) // update the title of a window or tab
|
||||||
SetLabel func(*Node, string) // update the "label" (aka "Name") for a widget
|
SetLabel func(*Node, string) // update the "label" (aka "Name") for a widget
|
||||||
SetChecked func(*Node, bool) // set the state of a checkbox
|
SetChecked func(*Node, bool) // set the state of a checkbox
|
||||||
|
ToolkitInit func() // init the plugin
|
||||||
ToolkitClose func() // shutdown and unload the plugin
|
ToolkitClose func() // shutdown and unload the plugin
|
||||||
Show func(*Node) // show a widget
|
Show func(*Node) // show a widget
|
||||||
Hide func(*Node) // hide a widget
|
Hide func(*Node) // hide a widget
|
||||||
|
|
Loading…
Reference in New Issue