Newer
Older
package views
import (
"github.com/gdamore/tcell"
"github.com/rivo/tview"
)
type ResultAndInputView struct {
resultAndInputView *tview.TextView
}
func NewResultAndInputView() *ResultAndInputView {
v := &ResultAndInputView{
resultAndInputView: tview.NewTextView(),
}
v.resultAndInputView.
SetDynamicColors(true).
SetRegions(true).
SetScrollable(true).
SetTitle("Result").
SetBorder(true).
SetBorderColor(tcell.ColorSteelBlue)
return v
}
func (r *ResultAndInputView) GetContent() tview.Primitive {
return r.resultAndInputView
}
func (r *ResultAndInputView) SetContent(s string) {
r.resultAndInputView.Clear()
r.resultAndInputView.SetText(s)
}