2019-01-24 04:12:10 +00:00
|
|
|
// +build ignore
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"image"
|
|
|
|
"log"
|
|
|
|
|
2019-03-07 10:50:20 +00:00
|
|
|
ui "github.com/gizak/termui/v3"
|
2019-01-24 04:12:10 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
if err := ui.Init(); err != nil {
|
|
|
|
log.Fatalf("failed to initialize termui: %v", err)
|
|
|
|
}
|
|
|
|
defer ui.Close()
|
|
|
|
|
|
|
|
c := ui.NewCanvas()
|
|
|
|
c.SetRect(0, 0, 50, 50)
|
2019-01-26 13:19:45 +00:00
|
|
|
c.SetLine(image.Pt(0, 0), image.Pt(10, 20), ui.ColorWhite)
|
2019-01-24 04:12:10 +00:00
|
|
|
|
|
|
|
ui.Render(c)
|
|
|
|
|
|
|
|
for e := range ui.PollEvents() {
|
|
|
|
if e.Type == ui.KeyboardEvent {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|