Cairo translate with mouse dragging

http://pastebin.com/d1a425431

Hi all!

I would like to have a DrawingArea + Cairo, which is zoomable and
pannable.

The Zoomable aspect is done by me, but I do not know how to implement
the pannable.

Which Gdk::Event should I enable to handle panning with left or middle
button drag?
Which signal to connect to?

thanks
Gergo


±[ Gergely K. [email protected] ]------------------+
| |
| Mobile:(+36 20)356 9656 |
| |
± “Olyan lángész vagyok, hogy poroltóval kellene járnom!” -+

Am Montag, den 28.04.2008, 18:32 +0200 schrieb KONTRA, Gergely:

button drag?
Which signal to connect to?

Hi,

check for Gdk::Event::BUTTON_PRESS for start of dragging, observe the
dragging with Gdk::Event::MOTION_NOTIFY and end it with
Gdk::Event::BUTTON_RELEASE . To get the information, wich button is
pressed use event.button from the signal handler.

Cheers, detlef

I thought BUTTON1_MOTION_MASK has to do something with dragging with
button1, but maybe I was wrong…

On Mon, Apr 28, 2008 at 9:34 PM, Detlef R. [email protected]
wrote:

the pannable.
Gdk::Event::BUTTON_RELEASE . To get the information, wich button is
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don’t miss this year’s exciting event. There’s still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone


ruby-gnome2-devel-en mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en


±[ Gergely K. [email protected] ]------------------+
| |
| Mobile:(+36 20)356 9656 |
| |
± “Olyan lángész vagyok, hogy poroltóval kellene járnom!” -+

And what about the drag-motion signal? What should I type to
add_events to be able to catch that? Or is that for something else?

On Tue, Apr 29, 2008 at 10:18 AM, KONTRA, Gergely [email protected]
wrote:

thanks
ruby-gnome2-devel-en mailing list
| |
| Mobile:(+36 20)356 9656 |
| |
± “Olyan lángész vagyok, hogy poroltóval kellene járnom!” -+


±[ Gergely K. [email protected] ]------------------+
| |
| Mobile:(+36 20)356 9656 |
| |
± “Olyan lángész vagyok, hogy poroltóval kellene járnom!” -+

Hi!

Thanks for the reply, I have completed the example, and refactored the
reusable parts.
(DragZoomDrawingArea should be reusable class)

Here is it:
http://pastebin.com/f63c6aaa9

Zooming respect current mouse position

On Mon, Apr 28, 2008 at 9:34 PM, Detlef R. [email protected]
wrote:

the pannable.
Gdk::Event::BUTTON_RELEASE . To get the information, wich button is
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don’t miss this year’s exciting event. There’s still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone


ruby-gnome2-devel-en mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en


±[ Gergely K. [email protected] ]------------------+
| |
| Mobile:(+36 20)356 9656 |
| |
± “Olyan lángész vagyok, hogy poroltóval kellene járnom!” -+

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs