Re: gtk_drawing_area and scrollbar

Hi Jozef,

The best solution is to make an "expose" handler which can paint any
rectangular part of your drawing area quickly. Put the drawing area
inside a scrolledwindow and it should all just work. To zoom, all you
do is change the size of the drawing area and queue a repaint.

It can be difficult to make an efficient expose handler for a CAD
application. The problem is that to paint an (x,y,w,h) area you
potentially have to walk over your whole model to find all the lines
that might need drawing. You might need something like a quadtree if
your model is large.


On Sun, 27 Jun 2004 22:06:14 +0200, Jozef Botka <jozob zoznam sk> wrote:
Hi, I have written an app., which read a file, parses it, and draws the contents to a gdk_pixmap 
simultaneously. After then the gdk_pixmap is drawn to gtk_drawing_area...............

I have also written some functions, which after clicking buttons zoomIN/OUT or move(left,right,up,down),  
recalculate coordinates of the content, that is going to be drawn to pixmap >> drawing_area, but does not 
recalculate the size of pixmap or drawing_area(I don't want it). It does not recalculate the size of pixmap 
and drawing_area, because if it is too high I get a seg. fault or some other error(ofcourse...).
I hope you understand it, as I think it is not the "common" way to do that things like that.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]