Re: Persistence with GDK



(snip)

   Ideally, I'd like to have some sort of "fire and forget" drawing method,
   whereby I can draw lots of things to a Gtk::Preview widget (equivalently
   to a GDK window), and have them stay there without having to remember what
   I've drawn.  One specific application would be a scientific plotting
   program; draw the axes, plot the data, plot labels on top of it, etc.
   Yes, it's usually pretty easy to just regenerate it, but ideally I'd like
   to be able to draw it and just have it stay there.

(snip)

   Is there any way to do what I'm hoping to do with GTK/GDK?

No.  The easiest way to do it is to create a backing GdkPixmap, and
draw everything to both the window and the pixmap.  Then when you get
an expose event, you can just copy the relevant part of the pixmap to
the window.

Also, if you want to use the Gnome libs, the Gnome Canvas will do it.
-- 
Joseph J. Pfeiffer, Jr., Ph.D.       Phone -- (505) 646-1605
Department of Computer Science       FAX   -- (505) 646-1002
New Mexico State University          http://www.cs.nmsu.edu/~pfeiffer
VL 2000 Homepage:  http://www.cs.orst.edu/~burnett/vl2000/




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