tui/views/textview.go

23 lines
329 B
Go
Raw Normal View History

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