Closed joschkazj closed 1 year ago
This appears to be another case of rubber-ducking: while investigating the issue I searched my application code for lines that called Tk's .update()
method and replaced them with calls to .update_idletasks()
which immediately solved the issue with cell display.
Apparently an ongoing update after populating my table widget interfered with the widget modifications/styling.
Thanks for creating
tksheet
it is really great to have a flexible table widget available in Python + Tk!I am using
tksheet
v6.2.0 and updating table cells based on results of a processing thread: the results are stored in the application class and an update method callshighlight_cells
to set background colors:at first, this results in the expected display: but as soon as I select another cell (same happens for one of the highlighted cells) the colors disappear again:
Before I dive too deep into this issue - does this behavior sound familiar to any of you and how could I fix it? As far as I've seen, the cell highlighting/color assignment is not undone anywhere else in the code - I still wonder what the correct way of updating the table widget display is: is it sufficient to trigger Tk's
.update_idletasks()
or do I need to explicitly call.refresh()
on the table?I've checked the display of the color example from the docs and there the background colors remain even after selecting and/or editing a cell.
Thanks in advance for any pointers or suggestions!