|
|
@ -311,11 +311,11 @@ func (t *TextView) SetTextColor(color tcell.Color) *TextView {
|
|
|
|
// SetText sets the text of this text view to the provided string. Previously
|
|
|
|
// SetText sets the text of this text view to the provided string. Previously
|
|
|
|
// contained text will be removed.
|
|
|
|
// contained text will be removed.
|
|
|
|
func (t *TextView) SetText(text string) *TextView {
|
|
|
|
func (t *TextView) SetText(text string) *TextView {
|
|
|
|
t.Lock()
|
|
|
|
batch := t.BatchWriter()
|
|
|
|
defer t.Unlock()
|
|
|
|
defer batch.Close()
|
|
|
|
|
|
|
|
|
|
|
|
t.clear()
|
|
|
|
batch.Clear()
|
|
|
|
fmt.Fprint(t, text)
|
|
|
|
fmt.Fprint(batch, text)
|
|
|
|
return t
|
|
|
|
return t
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|