diff options
| -rw-r--r-- | Makefile | 10 | ||||
| -rw-r--r-- | debug.go | 4 | ||||
| -rw-r--r-- | eventBindings.go | 1 | ||||
| -rw-r--r-- | eventMouseClick.go | 1 | ||||
| -rw-r--r-- | init.go | 8 | ||||
| -rw-r--r-- | plugin.go | 6 | ||||
| -rw-r--r-- | treeCallback.go (renamed from tree.go) | 0 |
7 files changed, 21 insertions, 9 deletions
@@ -1,10 +1,14 @@ VERSION = $(shell git describe --tags) BUILDTIME = $(shell date +%Y.%m.%d) -all: gocui.so - @#ldd gocui.so +all: goimports vet gocui + @ldd gocui.so -gocui.so: goimports +vet: + @GO111MODULE=off go vet + @echo this go plugin builds okay + +gocui: GO111MODULE=off go build -v -work -buildmode=plugin -o gocui.so \ -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}" @@ -55,6 +55,10 @@ func (w *guiWidget) dumpWidget(s string) { if w.node.WidgetType == widget.Box { end = fmt.Sprintf("%5s %-8s %s", w.cuiName, w.node.WidgetType, w.node.State.Direction.String()) } else { + curval := w.String() + if curval == "" { + curval = w.node.GetLabel() + } end = fmt.Sprintf("%5s %-8s %s", w.cuiName, w.node.WidgetType, w.String()) } log.Log(NOW, s1, s, end) diff --git a/eventBindings.go b/eventBindings.go index 6d2c613..e923f2d 100644 --- a/eventBindings.go +++ b/eventBindings.go @@ -124,7 +124,6 @@ func doPanic(g *gocui.Gui, v *gocui.View) error { log.Log(GOCUI, "do panic() here") standardClose() panic("forced panic in gocui") - return nil } func dumpWidgets(g *gocui.Gui, v *gocui.View) error { diff --git a/eventMouseClick.go b/eventMouseClick.go index d473a46..386e2cb 100644 --- a/eventMouseClick.go +++ b/eventMouseClick.go @@ -132,5 +132,4 @@ func click(g *gocui.Gui, v *gocui.View) error { return nil } */ - return nil } @@ -77,9 +77,9 @@ func standardClose() { me.baseGui.Close() log.Log(NOW, "standardExit() doing outf.Close()") outf.Close() - os.Stdin = os.Stdin - os.Stdout = os.Stdout - os.Stderr = os.Stderr + // os.Stdin = os.Stdin + // os.Stdout = os.Stdout + // os.Stderr = os.Stderr log.Log(NOW, "standardExit() send back Quit()") } @@ -110,7 +110,7 @@ func mainGogui() { outf, err = os.OpenFile("/tmp/captureMode.log", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666) if err != nil { - log.Error(err, "error opening file: %v") + log.Info("error opening file:", err) os.Exit(0) } origStdout = os.Stdout @@ -40,6 +40,7 @@ func newAdd(n *tree.Node) { w.Show() } +// for gocui as a GUI plugin, SetTitle & SetLabel are identical to SetText func newSetTitle(n *tree.Node, s string) { newSetText(n, s) } @@ -48,6 +49,9 @@ func newSetLabel(n *tree.Node, s string) { newSetText(n, s) } +// newSetText() and newAddText() are simple. They take the event sent +// to the GO plugin from the application and lookup the plugin structure +// then pass that event to gocui. This is the transfer point func newSetText(n *tree.Node, s string) { if n == nil { log.Warn("Tree Error: Add() sent n == nil") @@ -180,6 +184,7 @@ func (w *guiWidget) SetText(text string) { } } +/* func (w *guiWidget) Set(val any) { if w == nil { log.Log(WARN, "Set() w == nil. val =", val) @@ -196,3 +201,4 @@ func (w *guiWidget) Set(val any) { w.labelN = widget.GetString(val) } } +*/ diff --git a/tree.go b/treeCallback.go index 1ead288..1ead288 100644 --- a/tree.go +++ b/treeCallback.go |
