[Tkinter-discuss] TkInter won't update display on OS X if delay is too small

Leon Maurer leon.maurer at gmail.com
Sat Jan 12 18:33:15 CET 2013


It seems like putting a "root.update" before the "root.after" makes things
work well, even if I keep the small delay in the "root.after". Is this a
reasonable thing to do? Otherwise, I have to use a large enough delay that
it pushes an already slow animation in to slide show territory.
-Leon

On Sat, Jan 12, 2013 at 10:25 AM, Leon Maurer <leon.maurer at gmail.com> wrote:

> Oh well, thanks for the answer.
>
> Is there much data on how much of a delay is needed, and does it vary much
> from computer to computer? I'm trying to produce a smooth animation with
> the more complicated code, so adding a big delay isn't acceptable.
> -Leon
>
>
> On Sat, Jan 12, 2013 at 9:58 AM, Kevin Walzer <kw at codebykevin.com> wrote:
>>
>> You're running into a well-known and essentially unsolvable bug with Tk
>> on OS X, essentially integration between the event loop of Tk and Cocoa's
>> event loop. This is not a Tkinter issue, it's a Tk issue, and it's
>> essentially impossible to fix: the event loops of Tk and Cocoa are very
>> different and their integration is a fragile, leading at times to the kinds
>> of screen freeze/lockups you see. Increasing the delay between events a
>> bit, as you've done, is a recommended best practice, as it gives the event
>> loop time to spin and process the event queue; so you've essentially
>> already found the best solution for your problem.
>>
>> I'm speaking here at the maintainer of Tk on the Mac; we've discussed
>> these issues on the Tcl-Mac mailing list, the MacPython list, and here, and
>> a lot of talented developers besides myself have looked at it. No one has
>> been able to solve the issue, it's simply an inherent artifact that can
>> only be worked around.
>>
>> Thanks,
>> Kevin
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tkinter-discuss/attachments/20130112/5b144848/attachment-0001.html>


More information about the Tkinter-discuss mailing list