[pygtk] DrawingArea and mouse events
John Hunter
jdh2358 at gmail.com
Mon Nov 12 23:28:11 WST 2007
On Nov 9, 2007 2:51 AM, Donn <donn.ingle at gmail.com> wrote:
> > What you're looking for is, for some reason or another, known as a
> > "canvas".
> Okay. It seems I am writing my own canvas then. I am stuck on GTL+2.8 for a
> bunch of reasons so I have not been able to run any of the popular canvas
> apps.
>
> > People on the list might have suggestions for sorting through these.
> Right, more questions to a general audience then:-
>
> I hope someone can point me in the direction of how to calculate when an x,y
> is within the area of an object - based on it's closed-path shape not a
> general bounding area. That's something I am all at sea about.
if your object can describe itself as a polygon, you can use a "point
in polygon" test. matplotlib provides some code to do this which is
extremely fast.
from matplotlib import nxutils
b = nxutils.pnpoly(x, y, verts)
> For the "bubbling" of events through my objects, I think I have an angle on it
> and can start hacking.
Is this something that either using "draw_idle" or an idle handler
will help with?
JDH
More information about the pygtk
mailing list