[GH-ISSUE #1045] No way to set selected color on TreeView #754

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

Originally created by @SamWhited on GitHub (Oct 25, 2024).
Original GitHub issue: https://github.com/rivo/tview/issues/1045

With the list view you can set the color of the selected list item with SetSelectedTextColor, SetSelectedBackgroundColor and SetSelectedStyle. However, on tree views there is no similar styling, the selected node always swaps the foreground and background color.

I would like to propose adding similar methods to the tree view so that when using a treeview and a list view in the same UI there can be some consistency between the selector.

Originally created by @SamWhited on GitHub (Oct 25, 2024). Original GitHub issue: https://github.com/rivo/tview/issues/1045 With the list view you can set the color of the selected list item with `SetSelectedTextColor`, `SetSelectedBackgroundColor` and `SetSelectedStyle`. However, on tree views there is no similar styling, the selected node always swaps the foreground and background color. I would like to propose adding similar methods to the tree view so that when using a treeview and a list view in the same UI there can be some consistency between the selector.
kerem closed this issue 2026-03-04 01:07:31 +03:00
Author
Owner

@rivo commented on GitHub (Nov 3, 2024):

The latest commit adds SetTextStyle() and SetSelectedTextStyle() to TreeView.

<!-- gh-comment-id:2453453749 --> @rivo commented on GitHub (Nov 3, 2024): The latest commit adds `SetTextStyle()` and `SetSelectedTextStyle()` to `TreeView`.
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#754
No description provided.