minor changes

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-01-21 14:43:46 -06:00
parent b19c1e237d
commit 3a33ba5dad
4 changed files with 18 additions and 20 deletions

View File

@ -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

View File

@ -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())

View File

@ -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")
}

18
init.go
View File

@ -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)
}
}
}
@ -51,9 +41,9 @@ func New() *TreeInfo {
me.pluginChan = make(chan widget.Action, 1)
/*
full := "go.wit.com/gui"
short := "gui"
TREE = log.NewFlag("TREE", true, full, short, "treeRoot info")
full := "go.wit.com/gui"
short := "gui"
TREE = log.NewFlag("TREE", true, full, short, "treeRoot info")
*/
log.Log(TREE, "Init() start channel reciever")