25 lines
321 B
Go
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,
|
|
}
|
|
}
|