2019-01-24 04:12:10 +00:00
|
|
|
// +build ignore
|
|
|
|
|
2018-11-29 23:51:43 +00:00
|
|
|
package main
|
|
|
|
|
2019-01-24 04:12:10 +00:00
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
|
2019-03-07 10:50:20 +00:00
|
|
|
ui "github.com/gizak/termui/v3"
|
|
|
|
"github.com/gizak/termui/v3/widgets"
|
2019-01-24 04:12:10 +00:00
|
|
|
)
|
2018-11-29 23:51:43 +00:00
|
|
|
|
|
|
|
func main() {
|
2019-01-24 04:12:10 +00:00
|
|
|
if err := ui.Init(); err != nil {
|
|
|
|
log.Fatalf("failed to initialize termui: %v", err)
|
2018-11-29 23:51:43 +00:00
|
|
|
}
|
|
|
|
defer ui.Close()
|
|
|
|
|
2019-01-24 04:12:10 +00:00
|
|
|
p := widgets.NewParagraph()
|
|
|
|
p.Text = "Hello World!"
|
|
|
|
p.SetRect(0, 0, 25, 5)
|
|
|
|
|
2018-11-29 23:51:43 +00:00
|
|
|
ui.Render(p)
|
|
|
|
|
|
|
|
for e := range ui.PollEvents() {
|
|
|
|
if e.Type == ui.KeyboardEvent {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|