Re: drawing graphics



CAVEY GERARD wrote:

Hello
My app uses a GtkDrawingArea to display some data (lines & texts)  drawn
with gdk drawing primitives.
the main drawing function is linked with the expose_event of my drawing area

 gtk_signal_connect (GTK_OBJECT (drawingarea1), "expose_event",
 		GTK_SIGNAL_FUNC(DrawData),this);

thus my system is not very effective and my function is called for each
refresh request...
what would be the most effective solution ?
or where could i put the draw code so that it could be called only once ?
maybe i should use something else rather than drawing area???
(btw: my drawing function reads a hard drive file that s why i would avoid
to call it so much)

Hmm, in that case you have to use back buffer (usual GdkPixmap). You have to paint all graphics to that pixmap and draw pixmap on expose event. Look at scribble-simple example,
coming with gtk.

Olexiy




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