tui/views/textview.go

25 lines
321 B
Go
Raw Normal View History

2021-01-10 21:52:29 +01:00
package views
import (
"tui"
"git.tordarus.net/tordarus/buf2d"
)
type TextView struct {
tui.ViewTmpl
Text string
}
var _ tui.View = &TextView{}
func (v *TextView) Draw(buf *buf2d.Buffer) {
buf.WriteMultiLineString(v.Text, 0, 0)
}
func NewTextView(text string) *TextView {
return &TextView{
Text: text,
}
}