Tkinter Speed

Daniel Kramer daniel at visionart.com
Mon Jun 12 18:19:47 EDT 2000


I have a simple tcl/tk program.. it's only a canvas with some rectangles
on it.. you can move the rectangles around with the mouse on the canvas
interactively.

I am learning python and re-wrote this simple example with Tkinter as my
first python prog and it was much slower then the tcl/tk version.  I was
reading though past posts and it seems that you can call tk directly in
some way to gain a speed increase with Tkinter.. I tried to implement
this myself on my move command..

so my command looked like:

self.canvas.move("current", event.x - self.lastx, event.y - self.lasty)

I changed it to:

self.canvas.tk.call(self.canvas, 'move', 'current', event.x -
self.lastx, event.y - self.lasty)

Which works but isn't noticeably faster.   My tcl/tk app still feels
much faster.

I read that wxWindows is alot faster but I am a bit weary of going that
route.. Tkinter is so easy to use and I already know tk since I have
written many tcl/tk apps before... is there no way to get it to the same
speed as a tcl/tk app with Tkinter?

Thanks,

Daniel

--
-----------------------------------------------------------------------------
Daniel Kramer
http://www.visionart.com/~daniel/
daniel at visionart.com:           VisionArt Design and Animation






More information about the Python-list mailing list