discordo/ui/textviews.go
2021-08-18 22:15:22 +04:00

22 lines
434 B
Go

package ui
import (
"github.com/rivo/tview"
)
// NewMessagesTextView creates and returns a new messages textview.
func NewMessagesTextView(app *tview.Application) (textV *tview.TextView) {
textV = tview.NewTextView()
textV.
SetDynamicColors(true).
SetWordWrap(true).
ScrollToEnd().
SetChangedFunc(func() {
app.Draw()
}).
SetBorder(true).
SetBorderPadding(0, 0, 1, 0).
SetTitleAlign(tview.AlignLeft)
return
}