2019-01-23 21:12:10 -07:00
|
|
|
// +build ignore
|
|
|
|
|
2018-11-29 16:51:43 -07:00
|
|
|
package main
|
|
|
|
|
2019-01-23 21:12:10 -07:00
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
|
2022-08-28 10:37:35 -06:00
|
|
|
ui "git.tebitea.media/sashakoshka/termui/v3"
|
|
|
|
"git.tebitea.media/sashakoshka/termui/v3/widgets"
|
2019-01-23 21:12:10 -07:00
|
|
|
)
|
2018-11-29 16:51:43 -07:00
|
|
|
|
|
|
|
func main() {
|
2019-01-23 21:12:10 -07:00
|
|
|
if err := ui.Init(); err != nil {
|
|
|
|
log.Fatalf("failed to initialize termui: %v", err)
|
2018-11-29 16:51:43 -07:00
|
|
|
}
|
|
|
|
defer ui.Close()
|
|
|
|
|
2019-01-23 21:12:10 -07:00
|
|
|
p := widgets.NewParagraph()
|
|
|
|
p.Text = "Hello World!"
|
|
|
|
p.SetRect(0, 0, 25, 5)
|
|
|
|
|
2018-11-29 16:51:43 -07:00
|
|
|
ui.Render(p)
|
|
|
|
|
|
|
|
for e := range ui.PollEvents() {
|
|
|
|
if e.Type == ui.KeyboardEvent {
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|