tui/views/textview.go
2021-01-10 21:52:29 +01:00

25 lines
321 B
Go

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,
}
}