mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 21:35:54 +03:00
[GH-ISSUE #120] Idea of table cell blink? #92
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#92
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 @stephencheng on GitHub (May 23, 2018).
Original GitHub issue: https://github.com/rivo/tview/issues/120
Just wonder if there is decent way of make an animation of blinking cell when the content of the cell is updated to a different value, could this be a feature or I will have to implement it myself?
What I can think of are something like:
Any suggestion?
Thanks
@rivo commented on GitHub (May 23, 2018):
This depends heavily on your application and when/how you are putting data into the table. At some point, you are changing the contents of a cell. You could then compare the new content with the old content and, if the contents differ, start a goroutine which changes the background color back after some delay.
Note that while
Application.Draw()is thread-safe, the functions ofTableCellare not. So you may want to use async.Mutexto coordinate your goroutines.Of course, if you're updating many table cells at once, the logic would have to be slightly different, so as not to call
Draw()many times after each other.@stephencheng commented on GitHub (May 24, 2018):
Thanks for your suggestion. That's what I thought too.