[GH-ISSUE #143] How to force redraw primitives? #112

Closed
opened 2026-03-04 01:02:03 +03:00 by kerem · 3 comments
Owner

Originally created by @kovart on GitHub (Jul 26, 2018).
Original GitHub issue: https://github.com/rivo/tview/issues/143

Does the lib updates only if the keyboard input is captured?
What about self-updatable primitives?

Originally created by @kovart on GitHub (Jul 26, 2018). Original GitHub issue: https://github.com/rivo/tview/issues/143 Does the lib updates only if the keyboard input is captured? What about self-updatable primitives?
kerem closed this issue 2026-03-04 01:02:03 +03:00
Author
Owner

@rivo commented on GitHub (Jul 27, 2018):

Application.Draw() is called in response to a keyboard event because keyboard events typically lead to display changes.

If you make changes to a primitive independently, and especially in separate goroutines, you'll need to call Application.Draw() yourself. Some primitives give you tools to inform you that something has changed, for example the TextView "changed" event.

Let me know if this answers your question.

<!-- gh-comment-id:408472203 --> @rivo commented on GitHub (Jul 27, 2018): `Application.Draw()` is called in response to a keyboard event because keyboard events typically lead to display changes. If you make changes to a primitive independently, and especially in separate goroutines, you'll need to call `Application.Draw()` yourself. Some primitives give you tools to inform you that something has changed, for example [the `TextView` "changed" event](https://godoc.org/github.com/rivo/tview#TextView.SetChangedFunc). Let me know if this answers your question.
Author
Owner

@kovart commented on GitHub (Jul 28, 2018):

Yep. But, It could be better to call Draw method for specific primitive, or not?

<!-- gh-comment-id:408589323 --> @kovart commented on GitHub (Jul 28, 2018): Yep. But, It could be better to call Draw method for specific primitive, or not?
Author
Owner

@rivo commented on GitHub (Jul 28, 2018):

It seems that way at first but (most of the time) it's not. There's a longer discussion in #128 which you'll want to read. Feel free to add to that discussion if you have valuable input.

I'll close this issue but will reopen if it turns out it's still an open item.

<!-- gh-comment-id:408627613 --> @rivo commented on GitHub (Jul 28, 2018): It seems that way at first but (most of the time) it's not. There's a longer discussion in #128 which you'll want to read. Feel free to add to that discussion if you have valuable input. I'll close this issue but will reopen if it turns out it's still an open item.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#112
No description provided.