[cairo] PyGtk Drag and Drop in a gtk.DrawingArea
Donn
donn.ingle at gmail.com
Sat Jul 11 00:28:04 PDT 2009
On Saturday, 11 July 2009 05:05:21 Antoni Boucher wrote:
> I want to use drag and drop in a gtk.DrawingArea, but when I use it, it is
> very slow
Python is pretty slow. GTK on top of Python is slow. Cairo on top of Python is
slowish. Doing an intense loop that must draw stuff so quickly that the mouse
is the measure is going to fail.
You can do things to maximise the speed. Before your main drawing loop (where
you use cairo on the context):
1. Pre-calculate as many things as you can.
2. Have the least number of if commands possible.
Also I see you using surfaces in your code. I have noticed that those (via
Python-Cairo) are actually *very* slow. It's faster to draw things in pure
vectors, even if that means more python-cairo commands!
hth
\d
--
home: http://otherwise.relics.co.za/
2D vector animation : https://savannah.nongnu.org/projects/things/
Font manager : https://savannah.nongnu.org/projects/fontypython/
More information about the cairo
mailing list