Re: expose event & pixmap question
- From: Christian Seberino <seberino spawar navy mil>
- To: Paul Davis <pbd op net>
- Cc: gtk-list gnome org
- Subject: Re: expose event & pixmap question
- Date: Tue, 12 Mar 2002 11:48:38 -0800
Paul
It is slowly becoming clearer thanks to you. We can draw
on a pixmap which is associated with a window which
is part of a drawing area.
Configure/Expose events that *just* modify pixmaps work
great. I assume at the end of one of those callbacks
that some hidden routine says, "OK, now we need
to DISPLAY this pixmap on the window" and does it???
The reason I am asking is that I made one of these callbacks
be called at other times when a configure/expose event
was NOT fired -- with gtk_idle_add. Drawing on a pixmap
does NOT automagically change what is seen on GUI right???
How can I make these changes appear then (outside of a
configure/expose event)??
Sincerely,
Chris
On Thu, Feb 28, 2002 at 11:27:20AM -0500, Paul Davis wrote:
> >gint exposeEventHandler(GtkWidget* widget, GdkEventExpose* event) {
> > gdk_draw_pixmap(widget->window, widget->style->fg_gc[GTK_WIDGET_STATE(widge
> >t)],
> > Pixmaps::myPicture, event->area.x, event->area.y,
> > event->area.x, event->area.y, event->area.width, event->area.height);
> >
> > return FALSE;
> >};
> >
> >
> >Pixmaps make expose event handlers easy I think because you can just
> >redraw uncovered portion with a single function call as in function above.
> >
> >WHY CAN'T WE REDRAW A PORTION OF THE DRAWING AREA THE SAME
> >WAY AND AVOID NEED FOR PIXMAP?
>
> because we're shouting?
>
> its because a Pixmap is a different kind of resource than a
> Window. They are both considered to "drawables" - you can draw things
> on them by calling the gdk_draw_*() functions. However, a pixmap is an
> "offscreen" drawable that is never mapped to the display. A window in
> an "onscreen" drawable that can be mapped to the display. when you
> draw on a window, you are either going to fail (the window is not
> mapped), or the results show up "right away". when you draw in a
> pixmap, the results don't show up till you draw the pixmap into a
> window.
>
> a drawing area has a window, not a pixmap, as its drawable. if you
> want something else, then i suspect that the Canvas might be worth
> getting to know.
>
> does this make it any clearer?
>
> --p
--
=======================================================
| Dr. Christian Seberino || (619) 553-7940 (office) |
| SPAWARSYSCEN 2363 || (619) 553-2836 (fax) |
| 53560 HULL ST || |
| SAN DIEGO CA 92152-5001 || seberino spawar navy mil |
=======================================================
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]