mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 13:25:51 +03:00
[GH-ISSUE #228] Feature request: Adding TextViews or other Primitives into List #176
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#176
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @diamondburned on GitHub (Jan 18, 2019).
Original GitHub issue: https://github.com/rivo/tview/issues/228
Hello. I'm programming an application that requires changing live text data on the screen. Right now, I have one large TextView box that's formatted. However, I can't edit an existing text without seeking over the entire View.
It would be nice if there's a way to add small TextViews as List entries and set a unique identifier for them, so it's easier to iterate and replace the entry alone instead of the entire box.
@diamondburned commented on GitHub (Jan 18, 2019):
I have looked into Regions. There isn't a method to change Region texts afaik.
@rivo commented on GitHub (Jan 22, 2019):
I understand you want to have a way to edit the content of a
TextView. There is an open issue #64 which asks for an editableTextArea. However, this goes very deep into "text editor" territory so it's a larger project I will need to tackle at some point, nothing that I can offer quickly.As for your suggestion, I'm not sure how having a
TextViewinside aListentry would be different from whatListentries offer now already. If you can split your original text into lines yourself, you can put them in aList(or in aTable) and let the user select them. A selection could open anInputFieldsomewhere which allows the user to edit that line.If this is not what you're looking for, I'm afraid I'll need more information. Maybe you can construct a screenshot or something that illustrates what you're looking for.
@diamondburned commented on GitHub (Jan 23, 2019):
A list strips newlines off of subtitles for me, so it's not viable. Thanks for your help though.
@rivo commented on GitHub (Jan 23, 2019):
Again, it seems I have trouble understanding your requirement. I'll leave this issue open for a while so you can post more information that may help me come up with a solution for you.
@diamondburned commented on GitHub (Jan 25, 2019):
Regarding just the ListView part of my "requirement":
I figured if we could have a TextView box for the ListView elements instead of individual strings, that would allow for more things such as colors, formatting and new lines (which is what the issue is in the example).
@rivo commented on GitHub (Feb 14, 2019):
Apologies for the late reply.
Colors are allowed in lists:
I think the main issue is allowing multi-line list items. I'm not sure I will add this to a
Listin the near future. For something like this, theTextViewcan be used:But your first comment in this thread mentioned "editing" list items. So I'm not quite sure if this would cover everything you want to do.
@diamondburned commented on GitHub (Feb 15, 2019):
Thanks for replying. While developing my app, I have found out I could simply store the messages in an array and override the TextView when there's an edit. I thought the performance would be crap like in any GUI app I've ever worked with, but it turns out it worked really well.
@rivo commented on GitHub (Feb 15, 2019):
That's great. Thanks for the feedback.