Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flickering when modifying row data #135

Open
multizone-quant opened this issue Nov 11, 2022 · 2 comments
Open

Flickering when modifying row data #135

multizone-quant opened this issue Nov 11, 2022 · 2 comments

Comments

@multizone-quant
Copy link

Thanks for tksheet to use.

I have a question on flickering issue.
I use set_row_data() to modify the data at the specific row.
and then use refresh() to show on the screen

At that time whole data in the table are displayed again with flickering.

Here is the question.
Is is possible to display only update row without flickering?
or is it possible to display data without clear whole data in the table when i call refresh()?

Thank in advance.

@multizone-quant
Copy link
Author

I found the reason why flicking occurred.
There is problem on the following function, main_table_redraw_grid_and_text()

the widget which returned from self.hidd_text.popitem() does not match the loop variables, (c, r).
The returned widget is from the last one and (c,r) is incrementing from 0,0.

def main_table_redraw_grid_and_text(self, redraw_header = False, redraw_row_index = False, redraw_table = True):
    :
    if redraw_table:
        for c in range(start_col, end_col - 1):
            for r in rows_:
                             :
                            if self.hidd_text:
                                t, sh = self.hidd_text.popitem()

@ragardner
Copy link
Owner

ragardner commented Mar 13, 2023

This is intended and is not the reason for flickering, the popped item is configured with new settings and any left over items are hidden. Items are only created and then recycled, this is how items are redrawn without deleting and creating potentially millions of items which would eventually slow down the tkinter canvas.

I’m not sure why you’re having flickering though, are you using set_row_data() very often? you can use it with redraw = True in order to only refresh the table a single time after all your data setting has completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants