mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 21:35:54 +03:00
[GH-ISSUE #313] Refresh text #238
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#238
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 @zhouke66 on GitHub (Jun 18, 2019).
Original GitHub issue: https://github.com/rivo/tview/issues/313
I need to refreshed textView every once in a while, but It can only be refreshed when a key is pressed.
For example:
`package main
import (
"fmt"
"github.com/rivo/tview"
"strings"
"time"
)
const corporate =
[yellow]Leverage agile [red]frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition. Organically grow the holistic world view of disruptive innovation via workplace diversity and empowerment. Bring to the table win-win survival strategies to ensure proactive domination. At the end of the day, going forward, a new normal that has evolved from generation X is on the runway heading towards a streamlined cloud solution. User generated content in real-time will have multiple touchpoints for offshoring. Capitalize on low hanging fruit to identify a ballpark value added activity to beta test. Override the digital divide with additional clickthroughs from DevOps. Nanotechnology immersion along the information highway will close the loop on focusing solely on the bottom line. [[yellow]] press Enter, then Tab/Backtab for word selectionsfunc main() {
}
`
May I ask how to solve it?
@rivo commented on GitHub (Jun 18, 2019):
The solution to this is right in the example from which you copied your code:
github.com/rivo/tview@b62197ade4/demos/textview/main.go (L28-L30)The
changedcallback is executed every time you write something to aTextView.If you want to update on a different schedule, you can call
Application.Draw()any time.Let me know if this solves your problem.
@zhouke66 commented on GitHub (Jun 18, 2019):
Thank you, the problem has been solved