[pygtk] Zooming IN/OUT canvas item

Suresh Jeevanandam jm.suresh at gmail.com
Fri Dec 1 02:16:49 WST 2006

Hi all,
 In gnomecanvas.Canvas one can create the effect of zooming in and out by
calling set_pixels_per_unit from the canvas instance.

While zooming in or out, I have two options
[1] I can have the entire drawing area in the scrolledWindow (whose size
will increase as I zoom in)
[2] I can have only the visible area as the canvas's scroll region so that
the visible area size in pixels is a constant when I zoom in or out. But, I
will have to call set_scroll_region every time every time the user zoom in,
out, or moves the up,down,left,right ( I will connect the arrow key press
events to these operations) and there will not be a scrolled window.

Which of these two is preferred given that I have a bit of huge CAD data to
show. Right now, my implementation is with [1], and the tool hangs when
zoomed in deeply. I will try out [2] and update here. In the meantime I
would like to hear your views.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20061130/0eed6326/at=

More information about the pygtk mailing list