parent
b19c1e237d
commit
3a33ba5dad
10
Makefile
10
Makefile
|
@ -1,8 +1,16 @@
|
|||
redomod:
|
||||
all:
|
||||
@echo
|
||||
@echo "Run: make redomod # to remake the go files"
|
||||
@echo
|
||||
|
||||
redomod: goimports
|
||||
rm -f go.*
|
||||
GO111MODULE= go mod init
|
||||
GO111MODULE= go mod tidy
|
||||
|
||||
goimports:
|
||||
goimports -w *.go
|
||||
|
||||
download:
|
||||
go get -v go.wit.com/toolkits/debian
|
||||
go get -v go.wit.com/toolkits/tree
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
package tree
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"go.wit.com/log"
|
||||
"go.wit.com/widget"
|
||||
)
|
||||
|
@ -35,9 +33,9 @@ func (me *TreeInfo) AddNode(a *widget.Action) *Node {
|
|||
p := me.treeRoot.FindWidgetId(a.ParentId)
|
||||
n.Parent = p
|
||||
if n.Parent == nil {
|
||||
log.Error(errors.New("tree.AddNode() ERROR n.Parent == nil"), a.WidgetId, a.ParentId, a.ActionType)
|
||||
log.Warn("AddNode() ERROR n.Parent == nil", a.WidgetId, a.ParentId, a.ActionType)
|
||||
log.Warn("AddNode() ERROR n.Parent == nil", a.WidgetId, a.ParentId, a.WidgetType)
|
||||
log.Log(TREEWARN, "AddNode() ERROR n.Parent == nil n =", n.WidgetId, n.WidgetType, n.GetProgName())
|
||||
log.Log(TREEWARN, "AddNode() ERROR n.Parent == nil a =", a.WidgetId, a.WidgetType, a.State.ProgName)
|
||||
log.Log(TREEWARN, "AddNode() ERROR n.Parent == nil a.pid =", a.ParentId)
|
||||
return n
|
||||
}
|
||||
log.Log(TREE, "AddNode() Adding to parent =", p.ParentId, p.WidgetType, p.GetProgName())
|
||||
|
|
2
flags.go
2
flags.go
|
@ -5,9 +5,11 @@ import (
|
|||
)
|
||||
|
||||
var TREE *log.LogFlag
|
||||
var TREEWARN *log.LogFlag
|
||||
|
||||
func init() {
|
||||
full := "go.wit.com/gui"
|
||||
short := "tree"
|
||||
TREE = log.NewFlag("TREE", false, full, short, "treeRoot info")
|
||||
TREEWARN = log.NewFlag("TREEWARN", true, full, short, "treeRoot warnings")
|
||||
}
|
||||
|
|
12
init.go
12
init.go
|
@ -24,24 +24,14 @@ func (me *TreeInfo) catchActionChannel() {
|
|||
select {
|
||||
case a := <-me.pluginChan:
|
||||
log.Verbose("catchActionChannel() on ", a.WidgetId, a.WidgetType, a.ProgName)
|
||||
// log.Warn("catchActionChannel() STUFF", a.WidgetId, a.ActionType, a.WidgetType)
|
||||
/*
|
||||
if a.WidgetType == widget.Dropdown {
|
||||
log.Warn("Found dropdown", a.WidgetId, a.ActionType, a.WidgetType)
|
||||
for i, s := range a.State.Strings {
|
||||
log.Warn("a.State.Strings =", i, s)
|
||||
}
|
||||
}
|
||||
*/
|
||||
muAction.Lock()
|
||||
// send this to the toolkit
|
||||
if me.ActionFromChannel == nil {
|
||||
log.Error(errors.New("toolkit ActionFromChannel == nil"), a.WidgetId, a.ActionType, a.WidgetType)
|
||||
} else {
|
||||
// send this to the toolkit
|
||||
me.ActionFromChannel(a)
|
||||
}
|
||||
muAction.Unlock()
|
||||
// log.Log(TREE, "catchActionChannel() STUFF END", a.WidgetId, a.ActionType, a.WidgetType)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue