gocui panic loads nocui
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
bd24754c82
commit
0f9b7ec2af
|
@ -16,7 +16,7 @@ func (me *TreeInfo) AddNode(a *widget.Action) *Node {
|
||||||
// n.Strings = make(map[string]int)
|
// n.Strings = make(map[string]int)
|
||||||
// slices.Reverse(lines)
|
// slices.Reverse(lines)
|
||||||
// dropdown strings
|
// dropdown strings
|
||||||
n.ddStrings = make([]string, 0)
|
n.ddStrings = make([]string, 0)
|
||||||
for _, s := range a.State.Strings {
|
for _, s := range a.State.Strings {
|
||||||
n.ddStrings = append(n.ddStrings, s)
|
n.ddStrings = append(n.ddStrings, s)
|
||||||
}
|
}
|
||||||
|
|
7
init.go
7
init.go
|
@ -2,6 +2,7 @@ package tree
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
"runtime/debug"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
|
@ -13,6 +14,11 @@ var muAction sync.Mutex
|
||||||
// TODO: add checks for nil function pointers
|
// 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)
|
||||||
|
if n == nil {
|
||||||
|
log.Log(TREEWARN, "tree.FindWidgetId() n == nil", a.WidgetId, a.WidgetType, a.ActionType)
|
||||||
|
log.Log(TREEWARN, "tree.FindWidgetId() n == nil", a.State.CurrentS)
|
||||||
|
log.Log(TREEWARN, "tree.FindWidgetId() n == nil. This should not happen. Bug in gui or tree package?")
|
||||||
|
}
|
||||||
switch a.ActionType {
|
switch a.ActionType {
|
||||||
case widget.Add:
|
case widget.Add:
|
||||||
if n == nil {
|
if n == nil {
|
||||||
|
@ -70,6 +76,7 @@ func (me *TreeInfo) catchActionChannel() {
|
||||||
log.Log(TREEWARN, "YAHOOOO Recovered in tree.catchActionChannel()", r)
|
log.Log(TREEWARN, "YAHOOOO Recovered in tree.catchActionChannel()", r)
|
||||||
log.Log(TREEWARN, "YAHOOOO Recovered in tree.catchActionChannel() Plugin:", me.PluginName)
|
log.Log(TREEWARN, "YAHOOOO Recovered in tree.catchActionChannel() Plugin:", me.PluginName)
|
||||||
me.SendToolkitPanic()
|
me.SendToolkitPanic()
|
||||||
|
debug.PrintStack()
|
||||||
me.ToolkitClose()
|
me.ToolkitClose()
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
14
structs.go
14
structs.go
|
@ -24,13 +24,13 @@ type TreeInfo struct {
|
||||||
// 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)
|
||||||
SetText func(*Node, string)
|
SetText func(*Node, string)
|
||||||
SetTitle func(*Node, string)
|
SetTitle func(*Node, string)
|
||||||
SetLabel func(*Node, string)
|
SetLabel func(*Node, string)
|
||||||
SetChecked func(*Node, bool)
|
SetChecked func(*Node, bool)
|
||||||
ToolkitClose func()
|
ToolkitClose func()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue