[issue4117] missing update() in _Screen.setup() of Lib/turtle.py

Martin v. Löwis report at bugs.python.org
Wed Nov 19 22:04:43 CET 2008


Martin v. Löwis <martin at v.loewis.de> added the comment:

> I cannot call the Canvas method _update_idletasks() from within
> _Screen.setup() becaus this would contradict to the architecture of the
> module which isolates all direct references to Tkinter to
> TurtleScreenBase. (The idea behind this is to make the module easily
> portable, by porting only this class).

I find that desire misguided; this is (IMO) a case of false abstraction.
Is there any kind of proof that this design actually
works, i.e. can be ported to a different GUI library (like, say,
PythonWin? or AWT, when run in Jython?)

Unless such proof can be provided (and then integrated into the code),
I recommend to give up that objective, and start merging the base class
code into the subclasses where reasonable.

> Did you experience any problems or undesired behaviour
> because of using unly cv.update?

I agree with with gpolo: it's a general Tk programming principle to
defer updates whenever possible. This allows the event handler to return
more quickly, making the system more responsive. Each individual update
call will only contribute a small amount of time to the response time.
It's many of these which eventually make the entire system sluggish.

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4117>
_______________________________________


More information about the Python-bugs-list mailing list