diff options
Diffstat (limited to 'toolkit')
| -rw-r--r-- | toolkit/andlabs/Makefile | 2 | ||||
| -rw-r--r-- | toolkit/gocui/Makefile | 5 | ||||
| -rw-r--r-- | toolkit/gocui/common.go | 4 | ||||
| -rw-r--r-- | toolkit/gocui/main.go | 3 | ||||
| -rw-r--r-- | toolkit/gocui/place.go | 4 | ||||
| -rw-r--r-- | toolkit/gocui/structs.go | 10 |
6 files changed, 15 insertions, 13 deletions
diff --git a/toolkit/andlabs/Makefile b/toolkit/andlabs/Makefile index 65bd8f0..b839c33 100644 --- a/toolkit/andlabs/Makefile +++ b/toolkit/andlabs/Makefile @@ -1,7 +1,7 @@ all: plugin plugin: - GO111MODULE="off" go build -buildmode=plugin -o ../andlabs.so + GO111MODULE="off" go build -v -x -buildmode=plugin -o ../andlabs.so goget: GO111MODULE="off" go get -v -t -u diff --git a/toolkit/gocui/Makefile b/toolkit/gocui/Makefile index 43e804f..6c4f7d5 100644 --- a/toolkit/gocui/Makefile +++ b/toolkit/gocui/Makefile @@ -4,11 +4,8 @@ all: plugin goget: GO111MODULE="off" go get -v -t -u -build: - GO111MODULE="off" go build - plugin: - GO111MODULE="off" go build -buildmode=plugin -o ../gocui.so + GO111MODULE="off" go build -v -x -buildmode=plugin -o ../gocui.so objdump: objdump -t ../gocui.so |less diff --git a/toolkit/gocui/common.go b/toolkit/gocui/common.go index 93dfbb6..94b63b1 100644 --- a/toolkit/gocui/common.go +++ b/toolkit/gocui/common.go @@ -15,8 +15,8 @@ func makeWidget(a *toolkit.Action) *cuiWidget { w.b = a.B w.i = a.I w.s = a.S - w.x = a.X - w.y = a.Y + w.X = a.X + w.Y = a.Y t := len(w.text) diff --git a/toolkit/gocui/main.go b/toolkit/gocui/main.go index 0dd2c0a..20e85ac 100644 --- a/toolkit/gocui/main.go +++ b/toolkit/gocui/main.go @@ -88,11 +88,14 @@ func main() { if err != nil { exit("error opening file: %v", err) } + os.Stdout = outf defer outf.Close() // setOutput(outf) // log("This is a test log entry") + ferr, _ := os.OpenFile("/tmp/witgui.err", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0664) + os.Stderr = ferr MouseMain() log(true, "MouseMain() closed") diff --git a/toolkit/gocui/place.go b/toolkit/gocui/place.go index 124908f..bcb273b 100644 --- a/toolkit/gocui/place.go +++ b/toolkit/gocui/place.go @@ -209,10 +209,10 @@ func (w *cuiWidget) placeGrid() { if (w.heights[hCount] < child.realHeight) { w.heights[hCount] = child.realHeight } - log(logVerbose, "grid1: (w,h count)", wCount, hCount, "(X,Y)", w.x, w.y, w.name) + log(logVerbose, "grid1: (w,h count)", wCount, hCount, "(X,Y)", w.X, w.Y, w.name) child.showWidgetPlacement(logNow, "grid1: " + fmt.Sprintf("next()=(%2d,%2d)", w.nextW, w.nextH)) - if ((wCount + 1) < w.y) { + if ((wCount + 1) < w.X) { wCount += 1 } else { wCount = 0 diff --git a/toolkit/gocui/structs.go b/toolkit/gocui/structs.go index 09d1f33..e9f89af 100644 --- a/toolkit/gocui/structs.go +++ b/toolkit/gocui/structs.go @@ -157,8 +157,8 @@ type cuiWidget struct { b bool i int s string - x int - y int + X int + Y int width int height int @@ -205,10 +205,12 @@ func (w *cuiWidget) Write(p []byte) (n int, err error) { defer me.writeMutex.Unlock() if (me.logStdout.v == nil) { // optionally write the output to /tmp - fmt.Fprintln(outf, string(p)) + s := fmt.Sprint(string(p)) + s = strings.TrimSuffix(s, "\n") + fmt.Fprintln(outf, s) v, _ := me.baseGui.View("msg") if (v != nil) { - fmt.Fprintln(outf, "found msg") + // fmt.Fprintln(outf, "found msg") me.logStdout.v = v } } else { |
