Re: How to install animation
- From: Andreas Tille <tille physik uni-halle de>
 
- To: GTK User-List <gtk-list redhat com>
 
- cc: td_email usa net
 
- Subject: Re: How to install animation
 
- Date: Thu, 16 Jul 1998 08:13:21 +0200 (METDST)
 
Tim Wilson <td_email@usa.net> wrote:
> I would first look into gtk_timeout_add() in gtkmain.h.
> 
> Basically you would do this:
> 
> 1.) create an array of xpm images for the animation
> You should also make a variable (just use a global one in a simple test
> program)
> to hold the current frame of animation.
> 
> 2.) make a function to handle updating the current frame of animation (and
> draw the frame)
> This is simple to do.. example:
>   current_frame++;
>   if (current_frame > MAX_FRAMES)
>     current_frame = 0;
>   draw_xpm(xpm_array[current_frame]);
> 
> 3.) call gtk_timeout_add() with the function that handles updating animation
> ...
Fine, I think that's the solution I was looking for.  I hasn't found
gtk_timout_add before, but a deeper look into the tutorial led me
to chapter 15.  Thanks.
A further questiuon is the time behaviour of that method.  Presumed there
is no other work fot gtk_main().  How often (fast) is the timout called
compared with a function called from gtk which displays the images in a
for/while statement?
Kind regards
      Andreas.
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]