[cairo] Moving objects with mouse

Rui Tiago Cação Matos tiagomatos at gmail.com
Fri May 7 15:05:07 PDT 2010


2010/5/7 João Oliveira <joao.p.oliveira at iscte.pt>:
> I am quite new to gtk and cairo and I would like to ask what is the best way of doing the following very simple program:
>
> I want to draw 2 different rectangles in a drawing area widget (?). I want to be able to move them with de mouse freely in the drawing area. Is there a way to associate the mouse to a single rectangle? How the best (the simple) way of doing this?
> In the examples I saw, the objects were draw in the same widget. Is it possible to have different ones and simply move them in the window without have to redraw?
>
> So help would be very appreciate!

Have you looked at a canvas library like goocanvas[1]? It might be
more appropriate for your problem.

Rui

[1] http://live.gnome.org/GooCanvas


More information about the cairo mailing list