Persistence with GDK



I use GDK (actually GDK--) to draw to a Gtk::Preview widget.  It all
works.  However, if I hide and then expose the window (e.g. by moving
another window on top of it), everything I drew is gone.  This requires me
to keep full state information and set up the expose method of the preview
window to redraw everything I've drawn to it.

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.

Another application is displaying an image in the Gtk Preview widget, and
then drawing annotations on top of the image.  If I want to change the
image, I'll redo the annotations, but ideally I don't want to have to keep
track of all the annotations myself just to refresh them when the widget
is exposed.

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

Thanks,

-Rob






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