[cairo] drag objects (polygon) to desired position
bryce at osg.samsung.com
Fri Nov 14 11:28:37 PST 2014
On Fri, Nov 14, 2014 at 09:26:48PM +0530, David Boon wrote:
> I am trying to update a simulator which uses pycairo-pygtk. I needed
> to draw polygons on definite points (the user selects using mouse
> pointer) on runtime. Though I am able to draw polygons I am not able
> to really draw it in the desired position selected by the user.
> Is there a way to draw on specific points on screen as selected by the
> user or is it possible to drag the polygon to the desired position?
What you describe certainly sounds doable. Perhaps you need to
translate from the mouse's coordinate system to the screens?
There are lots and lots of pycairo/pygtk examples out there, so if you
dig around a bit you'll probably find something similar to what you're
trying to do, that can help clue you in. Otherwise, if you get really
stumped post a minimum test case here showing the problem and maybe
someone can take a look.
More information about the cairo