mirror of
https://github.com/rivo/tview.git
synced 2026-04-27 05:45:49 +03:00
[GH-ISSUE #811] How to use textview as terminal print #592
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#592
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 @zenithbb on GitHub (Feb 11, 2023).
Original GitHub issue: https://github.com/rivo/tview/issues/811
I have a function runs by some steps, I want each step print something in the terminal use textview, but problem is: before the func return, the text not show as expect.
below is the code, only third info is printed in the terminal
how can I print all info
@rivo commented on GitHub (Mar 25, 2023):
SetText()doesn't cause the text view to be redrawn. It is only redrawn afterDoSomething()returns, which happens after 6 seconds.It's generally not a good idea to block everything. So here's an non-blocking example which queues the update to the text view in the intervals used in your code: