Re: 'synchronous redraw' with a DrawingArea



Hi,

Pascal Ognibene <pascal ognibene libertysurf fr> writes:

> I've an application with one main window where I draw some
> diagrams, and a collection of dialog boxes, always transient for
> the main window (that is, they're always on the top).
> 
> When I do modifications in a dialog box and close it it should refresh
> the diagram immediately then close the box.
> 
> But it looks like the redraw of the drawing area is only made
> in parts not previously covered by the dialog box. As a result,
> some parts of the diagram are correct, while other
> are not redrawn until I scroll the window for example.
> 
> Is there any way to force the redraw 'synchronously' to be sure
> that the view is correct when the transient dialog box is closed?
> (note that I use the default double buffering of gtk2 for the
> drawing area)

X11 does enforce some restrictions on what you can do. The content of
a window obscured by another other windows needs be redrawn when it
becomes visible. There's basically no way around this. For this reason
your application window has to be able to redraw itself whenever a
part of it is exposed. You also must only draw in the expose_event
handler. If you follow that simple rule, things will just work.


Sven



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