mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 13:25:51 +03:00
[GH-ISSUE #6] Ability to update the view from a goroutine #4
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#4
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 @dpotapov on GitHub (Jan 10, 2018).
Original GitHub issue: https://github.com/rivo/tview/issues/6
Hi,
I'm running some parallel blocking job (like HTTP call) in a goroutine and would like to update the view once it is completed.
Since the main loop is blocked by
screen.PollEvent()the screen is not redrawing automatically. Some key/resize event have to trigger it. Another problem withSetFocus()- it blocks while polling events.Here is example:
@rivo commented on GitHub (Jan 11, 2018):
Thanks for the hint. I just pushed a change which will fix your example. I decided not to lock while polling for events. I don't see a reason why this couldn't be removed. I hope your issues are resolved with this now. If not, let me know. (Examples always help.)
I won't merge this pull request then.
By the way,
SetRoot()implicitly callsSetFocus().@rivo commented on GitHub (Jan 11, 2018):
Sorry, just saw that your change wasn't a pull request. So all good then.
@dpotapov commented on GitHub (Jan 11, 2018):
Thanks!
@AllanWang commented on GitHub (Mar 3, 2018):
@rivo sorry to bring this back from the dead, but some of your examples call
SetRoot()as well asSetFocus(). See flexbox. Maybe you'll want to update those examples?@rivo commented on GitHub (Mar 5, 2018):
Right. I missed that. Should be fixed with the latest commit (
c2f07f9548). Thanks.