Re: problem displaying rgb images on window



hi,

the gtk_widget_queue_draw_area() creates/forces an expose event on the drawing area in question; this event, then, to be processed by the mainLoop.

the while loop, then, forces all outstanding events sitting in the mainLoop event queue to be processed until all events are exahusted; essentially forcing your expose event callback code to be executed, immediately. (and, using this paradigm, this is the reason, too, you should do no drawing in the expose event except to render the pixmap to the physical display, i.e., it must be the end-point in the entire process of making and displaying your image).

you also use this while loop construct, for example, when wanting to update a progress meter while doing work in the background (that's being metered).

ta,

richard


On Aug 15, 2006, at 1:59 PM, Daniel Haude wrote:

On Wed, 26 Jul 2006 06:41:38 +0200, Richard Boaz <riboaz xs4all nl> wrote:

  gtk_widget_queue_draw_area(DrawingArea, 0, 0,
DrawingArea->allocation.width, DrawingArea->allocation.height);
  while (gtk_events_pending())
    gtk_main_iteration();
 }  // end while

What is the while loop for?





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