mirror of
https://github.com/rivo/tview.git
synced 2026-04-27 05:45:49 +03:00
[GH-ISSUE #203] [Question] How to redraw the element changes in treeview? #158
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#158
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 @thedevsaddam on GitHub (Dec 9, 2018).
Original GitHub issue: https://github.com/rivo/tview/issues/203
I want to redraw the tree after some changes in an element,
Code:
@rivo commented on GitHub (Dec 14, 2018):
First of all, please never call
app.ForceDraw()from a goroutine as it may cause race conditions. As mentioned in the function comments, you should probably never need to call this function at all.It is also not needed to periodically redraw the screen.
Application.Draw()is called automatically in response to events such as the "selected" event.In your
SetSelectedFunc()callback, you only modify your string slice. That has no effect on the tree view. If you want changes to the tree view, you'll also need to modify a tree node. Here's a version that may do what you need:Let me know if this solves your problem.