summaryrefslogtreecommitdiff
path: root/action.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-03-03 00:12:58 -0600
committerJeff Carr <[email protected]>2025-03-03 00:12:58 -0600
commit1e97138a1ca32f9f45974df8f7d093c15143b6ac (patch)
tree8a44888f08ddab33a73e4351f17d436720bf7e92 /action.go
parent3fb1d3ef70d6a82a8658866d9a14e13adbcf3104 (diff)
finally add a ToolkitInit()
Diffstat (limited to 'action.go')
-rw-r--r--action.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/action.go b/action.go
index 86ce14e..7a9c352 100644
--- a/action.go
+++ b/action.go
@@ -12,11 +12,26 @@ import (
// everything from the application goes through here
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 {
log.Log(TREEWARN, "tree: got a TablePB")
me.doTable(a)
return
}
+ if a.WidgetId == 0 {
+ if treeRoot == nil {
+ log.Log(TREEWARN, "tree.doAction() yes, treeRoot is nil. add here")
+ }
+ }
n := treeRoot.FindWidgetId(a.WidgetId)
switch a.ActionType {
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 bug in your application?")
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
}