mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 21:35:54 +03:00
[GH-ISSUE #895] Long text in TextView #654
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#654
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 @marek-kuticka on GitHub (Oct 3, 2023).
Original GitHub issue: https://github.com/rivo/tview/issues/895
Hi
what would be the best option to implement TextView component, inside some Flex container, or whatever, that contains scrollable text and I can keep focus at the end? something in sense of console logger.
I have bit struggles to getting this to work. would there be any example of this?
thx a lot
Marek
@rivo commented on GitHub (Oct 3, 2023):
You can call
TextView.ScrollToEnd():You can use
TextViewas aio.Writerand simply write your text to it (useSetChangedFunc()to redraw the text view). Make sure to also read the section on large texts.@marek-kuticka commented on GitHub (Oct 3, 2023):
thx, my question was rather aimed to adding text itself. what method is most suitable, and if TextView then handles the scroll by itself.
thx
@rivo commented on GitHub (Oct 4, 2023):
Not true.
TextViewbehaves exactly how it's described in the comment I quoted above. It will automatically scroll. It is not necessary to callScrollToEnd()every time something is changed, like in the example @digitallyserviced posted. Once is enough.@marek-kuticka Check out the following example which is how you could implement a continuous text stream (but again, please also look at the section about "Large Texts"):