diff options
| author | Jeff Carr <[email protected]> | 2024-01-21 14:43:46 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-21 14:43:46 -0600 |
| commit | 3a33ba5dad3c6307c74b859e8e9afe24b863a140 (patch) | |
| tree | ec434f9487f443d13707e77f2dc18b09e2cfc2af | |
| parent | b19c1e237db79b615a037b6034d45ac54c7ff233 (diff) | |
minor changesv0.0.8
Signed-off-by: Jeff Carr <[email protected]>
| -rw-r--r-- | Makefile | 10 | ||||
| -rw-r--r-- | addNode.go | 8 | ||||
| -rw-r--r-- | flags.go | 2 | ||||
| -rw-r--r-- | init.go | 18 |
4 files changed, 18 insertions, 20 deletions
@@ -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()) @@ -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") } @@ -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") |
