[GH-ISSUE #102] Feature: change List -> listitem -> Maintext for feature of showing status of on/off #80

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

Originally created by @stephencheng on GitHub (Apr 17, 2018).
Original GitHub issue: https://github.com/rivo/tview/issues/102

I am not sure if this feature is in there but I couldn't find it from source code.

Basically when I select a list item to execute a method, I'd like to add a visible change to the text/color of the listitems's maintext, eg,

initially the text is:

  • switch on light (status: off)

Action: click, the main text turns to below fake code:

  • switch off light (status: on)</green color>

Action: click again, the main text turns to initial text

I'd like a exported method such as

  • List.SetMainText(index int, text string)
  • List.SetSecondaryText(index int, text string)

Since you already supplied a method: GetCurrentItem to obtain the current item's index, it's all set if these methods could be exposed.

Thanks

Originally created by @stephencheng on GitHub (Apr 17, 2018). Original GitHub issue: https://github.com/rivo/tview/issues/102 I am not sure if this feature is in there but I couldn't find it from source code. Basically when I select a list item to execute a method, I'd like to add a visible change to the text/color of the listitems's maintext, eg, initially the text is: - switch on light (status: off) Action: click, the main text turns to below fake code: - switch off light <green color>(status: on)</green color> Action: click again, the main text turns to initial text I'd like a exported method such as - List.SetMainText(index int, text string) - List.SetSecondaryText(index int, text string) Since you already supplied a method: GetCurrentItem to obtain the current item's index, it's all set if these methods could be exposed. Thanks
kerem closed this issue 2026-03-04 01:01:44 +03:00
Author
Owner

@rivo commented on GitHub (Apr 19, 2018):

Please have a look at the referenced commit. This should give you functions to change a list item's text.

<!-- gh-comment-id:382850751 --> @rivo commented on GitHub (Apr 19, 2018): Please have a look at the referenced commit. This should give you functions to change a list item's text.
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#80
No description provided.