mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 21:35:54 +03:00
[GH-ISSUE #258] Adding Rows to Table After Root is set #201
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#201
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 @SaltyPotatoes2 on GitHub (Apr 4, 2019).
Original GitHub issue: https://github.com/rivo/tview/issues/258
I'm noticing that it is impossible to add rows to Tables using table.InsertRow after app.SetRoot has been set. Is this intentional, is there a way to allow the additions of rows after the fact?
@rivo commented on GitHub (Apr 5, 2019):
I don't see why this wouldn't work. Here's an example:
Maybe you're updating the table in a goroutine? If so, please check out this Wiki article on concurrency in
tview.@SaltyPotatoes2 commented on GitHub (Apr 7, 2019):
I was unable to get QueueUpdateDraw to work, or anything outside of a tview event function; so I got it updating by adding this as my main loop:
Then an After Draw function:
Not ideal, but not terrible by any means.
@rivo commented on GitHub (May 13, 2019):
This looks to me like you'll have an extremely busy loop (maybe
time.Sleep()would be better for something like this?).I don't know why
QueueUpdateDraw()did not work for you but if you would like me to follow up on it, please send me an example where you tried it and where it didn't work. I'll reopen this issue in that case.