diff options
| author | Jeff Carr <[email protected]> | 2024-11-13 21:32:44 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-11-13 21:32:44 -0600 |
| commit | 368c25107a9343d3368182efbe203acb4fbf8d5e (patch) | |
| tree | c44de9dbb34ef01daac6e77ea598a687457dc560 /gocui.go | |
| parent | 2ace17294c0a20f889bb1e800a1c35e3cbd995df (diff) | |
test writes to stdout widget kinda work
Diffstat (limited to 'gocui.go')
| -rw-r--r-- | gocui.go | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -6,12 +6,15 @@ package main import ( "errors" + "fmt" "github.com/awesome-gocui/gocui" "go.wit.com/log" ) +var ecount int = 3 + // Thanks to the gocui developers -- your package kicks ass // This function is called on every event. It is a callback function from the gocui package // which has an excellent implementation. While gocui handles things like text highlighting @@ -19,6 +22,7 @@ import ( // complicated console handling, it sends events here in a clean way. // This is equivalent to the linux command xev (apt install x11-utils) func gocuiEvent(g *gocui.Gui) error { + ecount += 1 maxX, maxY := g.Size() mx, my := g.MousePosition() log.Verbose("handleEvent() START", maxX, maxY, mx, my, msgMouseDown) @@ -32,7 +36,13 @@ func gocuiEvent(g *gocui.Gui) error { // setOutput(me.logStdout) // me.logStdout.Write("test out") w := me.logStdout.TK.(*guiWidget) - w.Write([]byte("test out")) + msg := fmt.Sprintf("test out %d\n", ecount) + msg += fmt.Sprintf("test out %d\n", ecount) + msg += fmt.Sprintf("test out %d\n", ecount) + w.Write([]byte(msg + msg + msg)) + w.Write([]byte(msg + msg + msg)) + w.Write([]byte(msg + msg + msg)) + w.Write([]byte(msg + msg + msg)) // log.CaptureMode(w) log.Log(NOW, "logStdout test out") } |
