Re: How to refresh a Drawingarea?



Hi,

Havoc Pennington wrote:

Luciano Ponte <l ponte pronet it> writes:
I have written a small application that draws a line on a drawingarea
by clicking  on a button.
The problem is that this line remain invisible until I hide the
drawingarea by another window and then unhide it. How can I force the
redraw of such a drawing area in order to shows its contents?

gtk_widget_queue_draw() on the drawing area. (also
gtk_widget_queue_draw_area() to draw only a subpart)

This doesn't work for me. Also gdk_flush_something(?) doesn't work. Is
this because the call does not come from the gtk main loop, but from
another thread, or pehaps it has something to do with
gdk_threads_enter()...gdk_threads_leave()? After the first call of
gtk_draw_rgb_image() the drawing area which has initially x- and
y-dimensions of 0 gets resized correctly, but with no image displayed.
After a second call of gtk_draw_Rgb_image with another image to draw,
this gets displayed.
It's similar with some additional gtk_draw_rectangle calls after the
gtk_draw_rgb_image() call. You can see them flicker shortly in the
drawing area, but get immediatly overwritten by the image, as if gtk
draws them in inverse order.

Thomas
-- 
Thomas Kulessa                          GMD/IMK/Mars - Exploratory Media Lab
                                        Schloss Birlinghoven
Phone : +49-2241-14-2166                53754 Sankt Augustin
eMail : thomas kulessa gmd de           Germany




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