tui/views/textview.go
2022-04-01 20:10:51 +02:00

23 lines
329 B
Go

package views
import (
"git.tordarus.net/Tordarus/tui"
)
type TextView struct {
tui.ViewTmpl
Text string
}
var _ tui.View = &TextView{}
func (v *TextView) Draw(buf *tui.ViewBuffer) {
tui.WriteMultiLineString(buf, v.Text, v.Style(), 0, 0)
}
func NewTextView(text string) *TextView {
return &TextView{
Text: text,
}
}