[GH-ISSUE #221] No colors in TextView text #170

Closed
opened 2026-03-04 01:02:35 +03:00 by kerem · 1 comment
Owner

Originally created by @dguendisch on GitHub (Jan 10, 2019).
Original GitHub issue: https://github.com/rivo/tview/issues/221

I must be missing something simple, but my trivial code does not color the text of a TextView (but does color e.g. its border):

text := tview.NewTextView()
text.SetBorder(true).SetTitle("a[red]bc")
text.SetText("d[red]ef")
tview.NewApplication().SetRoot(text, true).Run()
main3 go 2019-01-10 23-10-31
Originally created by @dguendisch on GitHub (Jan 10, 2019). Original GitHub issue: https://github.com/rivo/tview/issues/221 I must be missing something simple, but my trivial code does not color the text of a TextView (but does color e.g. its border): ``` text := tview.NewTextView() text.SetBorder(true).SetTitle("a[red]bc") text.SetText("d[red]ef") tview.NewApplication().SetRoot(text, true).Run() ``` <img width="128" alt="main3 go 2019-01-10 23-10-31" src="https://user-images.githubusercontent.com/30311254/51000685-19615980-152e-11e9-96fb-8066e7f8bca5.png">
kerem closed this issue 2026-03-04 01:02:36 +03:00
Author
Owner

@dguendisch commented on GitHub (Jan 11, 2019):

Ok, this was missing:

text.SetDynamicColors(true)
<!-- gh-comment-id:453471331 --> @dguendisch commented on GitHub (Jan 11, 2019): Ok, this was missing: ``` text.SetDynamicColors(true) ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#170
No description provided.