Re: [gtk-list] How to trigger configure event in animation



Andreas Tille wrote:

> I've written an image viewer with animation capabilities
> (paul at http://www.physik.uni-halle.de/~e2od5/paul.html).
> It worked well under GTK+1.0.? but since I switched to
> 1.[12]-series I have a problem with different sized images.
> My expectation is, that the configure event is triggered at the
> wrong time, but I don't know how to do it right.


You haven't thought through the sequence of events.

 o Timeout occurs - Animate() gets size of current image and requests
   change in window size to display it. Then sets current image to the
   next one! (this is the mistake!)

 o X server/window manager responds to window size request, and
   dispatches configure event.

 o ConfigureCallback() is called which displays the current image,
   which is now the wrong one.

This patch makes it a bit better. Though I'm not sure you should
display the image in Animate() if you are changing the window size,
since it will be displayed again in the configure event.


Damon


--- animate.c.orig      Tue Apr 27 20:08:27 1999
+++ animate.c   Tue Apr 27 20:08:37 1999
@@ -38,8 +38,8 @@
   if ( ANIFLAG ) return 1;  /* avoid displaying if timout is faster than display */
    
   ANIFLAG  = 1;
-  ApplyPicture((p->show)->window, BILD(p->activ));
   p->activ = (p->activ)->next;
+  ApplyPicture((p->show)->window, BILD(p->activ));
   ANIFLAG  = 0;
 
   return 1;




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