Open insolor opened 1 year ago
Thank you for this libraray: I got same issue.
My solution was to turn things around. Instead of running tkinter on top of async, it runs async loop inside tkinter.
We start tkinter and register callback 1ms later. In callback from tkinter we do blocking call
Proof of concept: https://gist.github.com/ra1u/8aa66c09e985dd2a9fe297bcd222ddf7
@ra1u interesting, I'll take a look later
@insolor Any updates on this? Most probably the issue I am facing is also related to this. When I let a long running async function start and then drag the tkinter window the async function pauses and continues again only after I leave the window from dragging.
@ghmanoj this is probably a similar problem, but not the same one. In your case, if you need a non-stopping async function try to run the function in a separate thread, it should help (it won't help with dialogs though).
If i recall correctly there is "bug" in MS Windows tkinter, that when you drag window around holding top menu bar, there is 100% cpu utilisation, because Windows is sending lot notifications on tkinter. Workaround is, that you replace default top bar, with tkinter widget including custom bar and custom X button on right. I am not sure that what is presented in current issue will help with this 100% cpu issue.
In the following code (pure tkinter) counter continues to work while messagebox dialog is shown:
But with the corresponding code with
async_tkinter_loop
counter is paused when messagebox is shown: