Re: how to make an animation ;)
- From: Olivier Ramare <Olivier Ramare univ-lille1 fr>
- To: gtk-app-devel-list gnome org
- Subject: Re: how to make an animation ;)
- Date: Fri, 09 Feb 2007 01:02:20 +0100
Enrico Sardi wrote:
Hi all!
I want to make a simple animation in gtk with a pixbuf that rotates, how
can I make it?
For every change of state of my application, the image changes.
I have 10 files with the rotated images (I've created them with
a repeated use of gimp) and I use the following code:
----------------------------------------------------------------------------------------------------------------------
#define GTK_FLUSH while (gtk_events_pending()) gtk_main_iteration();
void wait_fine(float intervalle)
{
float lheure = (clock()/CLOCKS_PER_SEC);
while(((clock()/CLOCKS_PER_SEC) - lheure) < intervalle){;};
}
void set_image(char *nom_image)
{
my_gtk_image_set_from_file(GTK_IMAGE(SG_Icone), nom_image);
GTK_FLUSH; wait_fine(delai_d_installation_image);
}
void set_images(char *im1, char *im2, char *im3, char *im4, char *im5,
char *im6, char *im7, char *im8, char *im9, char *im10)
{
set_image(im1); set_image(im2); set_image(im3); set_image(im4);
set_image(im5); set_image(im6); set_image(im7); set_image(im8);
set_image(im9); set_image(im10);
}
----------------------------------------------------------------------------------------------------------------------
That's simpleminded --
HTH still :-)
Olivier
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]