From a78eadea024c2b283b45f1711aeda39d60deab22 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 18 Jan 2024 04:08:11 -0600 Subject: [PATCH] paths Signed-off-by: Jeff Carr --- Makefile | 7 +++++++ addNode.go | 6 +++--- common.go | 2 +- debug.go | 4 ++-- event.go | 12 ++++++------ go.mod | 2 +- go.sum | 4 ++-- init.go | 6 +++--- json.go | 2 +- plugin.go | 6 +++--- structs.go | 22 +++++++++++----------- 11 files changed, 40 insertions(+), 33 deletions(-) diff --git a/Makefile b/Makefile index 186078d..c5ba527 100644 --- a/Makefile +++ b/Makefile @@ -2,3 +2,10 @@ redomod: rm -f go.* GO111MODULE= go mod init GO111MODULE= go mod tidy + +download: + go get -v go.wit.com/toolkits/debian + go get -v go.wit.com/toolkits/tree + go get -v go.wit.com/toolkits/nogui + go get -v go.wit.com/toolkits/gogui + go get -v go.wit.com/toolkits/andlabs diff --git a/addNode.go b/addNode.go index 36c5a06..ab0e687 100644 --- a/addNode.go +++ b/addNode.go @@ -4,7 +4,7 @@ import ( "errors" "go.wit.com/log" - "go.wit.com/lib/widget" + "go.wit.com/widget" ) // this is in common.go, do not move it @@ -17,14 +17,14 @@ func (me *TreeInfo) AddNode(a *widget.Action) *Node { n.State = a.State n.Strings = make(map[string]int) - if (a.WidgetType == widget.Root) { + if a.WidgetType == widget.Root { log.Info("AddNode() Root") n.Parent = n me.treeRoot = n return n } - if (me.treeRoot.FindWidgetId(a.WidgetId) != nil) { + if me.treeRoot.FindWidgetId(a.WidgetId) != nil { log.Warn("AddNode() WidgetId already exists", a.WidgetId) log.Warn("probably this is a Show() / Hide() issue") log.Warn("TODO: figure out what to do here") diff --git a/common.go b/common.go index 2ae4f9e..8af469d 100644 --- a/common.go +++ b/common.go @@ -1,7 +1,7 @@ package tree import ( - "go.wit.com/lib/widget" + "go.wit.com/widget" ) func (n *Node) GetProgName() string { diff --git a/debug.go b/debug.go index 64883ee..1978d19 100644 --- a/debug.go +++ b/debug.go @@ -2,7 +2,7 @@ package tree import ( "go.wit.com/log" - "go.wit.com/lib/widget" + "go.wit.com/widget" ) func (n *Node) ShowButtons() { @@ -22,7 +22,7 @@ func (n *Node) DumpWidget(pad string) { var depth int = 0 func (n *Node) ListWidgets() { - if (n == nil) { + if n == nil { log.Warn("ERRRORRRR: n == nil in ListWidgets()") log.Warn("ERRRORRRR: n == nil in ListWidgets()") log.Warn("ERRRORRRR: n == nil in ListWidgets()") diff --git a/event.go b/event.go index 845b47b..d2383af 100644 --- a/event.go +++ b/event.go @@ -13,11 +13,11 @@ package tree import ( "go.wit.com/log" - "go.wit.com/lib/widget" + "go.wit.com/widget" ) func (me *TreeInfo) DoEnableDebugger() { - if (me.callback == nil) { + if me.callback == nil { log.Warn("DoUserEvent() toolkit panic() callback == nil") return } @@ -29,7 +29,7 @@ func (me *TreeInfo) DoEnableDebugger() { } func (me *TreeInfo) DoToolkitLoad(s string) { - if (me.callback == nil) { + if me.callback == nil { log.Warn("DoUserEvent() toolkit load callback == nil") return } @@ -44,7 +44,7 @@ func (me *TreeInfo) DoToolkitLoad(s string) { } func (me *TreeInfo) DoToolkitPanic() { - if (me.callback == nil) { + if me.callback == nil { log.Warn("DoUserEvent() toolkit panic() callback == nil") return } @@ -58,7 +58,7 @@ func (me *TreeInfo) DoToolkitPanic() { } func (me *TreeInfo) DoWindowCloseEvent(n *Node) { - if (me.callback == nil) { + if me.callback == nil { log.Warn("DoUserEvent() callback == nil", n.WidgetId) return } @@ -73,7 +73,7 @@ func (me *TreeInfo) DoWindowCloseEvent(n *Node) { // Other goroutines must use this to access the GUI func (me *TreeInfo) DoUserEvent(n *Node) { - if (me.callback == nil) { + if me.callback == nil { log.Warn("DoUserEvent() callback == nil", n.WidgetId) return } diff --git a/go.mod b/go.mod index 6f2cb79..e563fdf 100644 --- a/go.mod +++ b/go.mod @@ -3,8 +3,8 @@ module go.wit.com/toolkits/tree go 1.21.4 require ( - go.wit.com/gui/widget v1.1.4 go.wit.com/log v0.5.5 + go.wit.com/widget v1.1.5 ) require go.wit.com/dev/davecgh/spew v1.1.4 // indirect diff --git a/go.sum b/go.sum index 4704880..f6edf55 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,6 @@ go.wit.com/dev/davecgh/spew v1.1.4 h1:C9hj/rjlUpdK+E6aroyLjCbS5MFcyNUOuP1ICLWdNek= go.wit.com/dev/davecgh/spew v1.1.4/go.mod h1:sihvWmnQ/09FWplnEmozt90CCVqBtGuPXM811tgfhFA= -go.wit.com/gui/widget v1.1.4 h1:dCztWNSuTSSP+/M8h8F3cT7vWtoKdCL3DUQql0qLKdk= -go.wit.com/gui/widget v1.1.4/go.mod h1:A6/FaiFQtAHTjgo7c4FrokXe6bXX1Cowo35b2Lgi31E= go.wit.com/log v0.5.5 h1:bK3b94uVKgev4jB5wg06FnvCFBEapQICTSH2YW+CWr4= go.wit.com/log v0.5.5/go.mod h1:BaJBfHFqcJSJLXGQ9RHi3XVhPgsStxSMZRlaRxW4kAo= +go.wit.com/widget v1.1.5 h1:jx5hJ2WLZJnCcvMuaLHegzpNlzwo+0kOkzsRkzRiB30= +go.wit.com/widget v1.1.5/go.mod h1:I8tnD3x3ECbB/CRNnLCdC+uoyk7rK0AEkzK1bQYSqoQ= diff --git a/init.go b/init.go index 55e434d..03bbe4f 100644 --- a/init.go +++ b/init.go @@ -1,11 +1,11 @@ package tree import ( - "sync" "errors" + "sync" "go.wit.com/log" - "go.wit.com/lib/widget" + "go.wit.com/widget" ) var muAction sync.Mutex @@ -29,7 +29,7 @@ func (me *TreeInfo) catchActionChannel() { log.Info("catchActionChannel() START") for { log.Info("catchActionChannel() for loop") - select { + select { case a := <-me.pluginChan: log.Info("catchActionChannel() SELECT widget id =", a.WidgetId, a.ProgName) log.Warn("catchActionChannel() STUFF", a.WidgetId, a.ActionType, a.WidgetType) diff --git a/json.go b/json.go index 68fe398..fb671af 100644 --- a/json.go +++ b/json.go @@ -4,7 +4,7 @@ import ( "fmt" "go.wit.com/log" - "go.wit.com/lib/widget" + "go.wit.com/widget" ) // makes a JSON version to pass to the toolkits ? diff --git a/plugin.go b/plugin.go index e8c61da..cfa1fb4 100644 --- a/plugin.go +++ b/plugin.go @@ -12,12 +12,12 @@ package tree */ import ( - "go.wit.com/lib/widget" + "go.wit.com/widget" ) // searches the binary tree for a WidgetId func (n *Node) FindWidgetId(id int) *Node { - if (n == nil) { + if n == nil { return nil } @@ -27,7 +27,7 @@ func (n *Node) FindWidgetId(id int) *Node { for _, child := range n.children { newN := child.FindWidgetId(id) - if (newN != nil) { + if newN != nil { return newN } } diff --git a/structs.go b/structs.go index e4d7418..4ff96c7 100644 --- a/structs.go +++ b/structs.go @@ -13,12 +13,12 @@ package tree import ( // "go.wit.com/log" - "go.wit.com/lib/widget" + "go.wit.com/widget" ) // var me *TreeInfo -type TreeInfo struct { +type TreeInfo struct { // this is the channel we send user events like // mouse clicks or keyboard events back to the program callback chan widget.Action @@ -26,21 +26,21 @@ type TreeInfo struct { // this is the channel we get requests to make widgets pluginChan chan widget.Action - treeRoot *Node - NodeI interface {} - ActionFromChannel func (widget.Action) () - PluginName string + treeRoot *Node + NodeI interface{} + ActionFromChannel func(widget.Action) + PluginName string } type Node struct { - Parent *Node + Parent *Node children []*Node - WidgetId int // widget ID - WidgetType widget.WidgetType - ParentId int // parent ID + WidgetId int // widget ID + WidgetType widget.WidgetType + ParentId int // parent ID - State widget.State + State widget.State Strings map[string]int