Closed DaleEMoore closed 4 years ago
Perhaps I would be better off if I read the v2 to v3 documentation. Could anybody tell me where to go?
Howdy y'all; Thanks to everyone whom contributed their time and effort! Here's what seems to be working fine for me now:
// DaleEMoore@gMail.Com
// termui v3 implementation got me "undefined: termui.Handle"
package main
import (
"fmt"
"os"
)
import termui "github.com/gizak/termui/v3"
func main() {
err := termui.Init()
if err != nil {
panic(err)
}
defer termui.Close()
fmt.Println("q)uit, CTRL-c, other gets printed.")
uiEvents := termui.PollEvents()
for {
e := <-uiEvents
switch e.ID {
case "q":
fmt.Println("q")
os.Exit(212)
case "<c-c":
fmt.Println("C-c")
os.Exit(230)
default:
fmt.Println("other ", e.ID)
}
}
}
// .vimrc needs ":set modeline" in Ubuntu to turn on modeline processing.
// Make the following line the last line of the file, always.
// vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
Please pardon my noviceness! I'm perplexed that Handle is undefined. I had some almost functioning v2 code that I had hopes would be improved by trying it with v3. But it seems like Handle has disappeared in v3 and I'm unsure what direction to head now. Here is a piece of code that I've crafted showing my issue.
Any help you can provide is very much appreciated! DaleEMoore@gMail.Com