/** gnomeanimator.c **/ #include #include "animator.xpm" static char **anim[] = { anim1,anim2,anim3,anim4,anim5 }; gint eventDelete(GtkWidget *widget, GdkEvent *event,gpointer data); gint eventDestroy(GtkWidget *widget, GdkEvent *event,gpointer data); static GtkWidget *makeWidget(); int main(int argc,char *argv[]) { GtkWidget *app; GtkWidget *widget; gnome_init("gnomeanimator","1.0",argc,argv); app = gnome_app_new("gnomeanimator","GnomeAnimator"); gtk_container_set_border_width(GTK_CONTAINER(app),20); gtk_signal_connect(GTK_OBJECT(app),"delete_event", GTK_SIGNAL_FUNC(eventDelete),NULL); gtk_signal_connect(GTK_OBJECT(app),"destroy", GTK_SIGNAL_FUNC(eventDestroy),NULL); widget = makeWidget(); gnome_app_set_contents(GNOME_APP(app),widget); gtk_widget_show_all(app); gtk_main(); exit(0); } gint eventDelete(GtkWidget *widget, GdkEvent *event,gpointer data) { return(FALSE); } gint eventDestroy(GtkWidget *widget, GdkEvent *event,gpointer data) { gtk_main_quit(); return(0); } static GtkWidget *makeWidget() { int i; GtkWidget *animator; GtkWidget *pixmap; animator = gnome_animator_new_with_size(100,100); for(i=0; i<5; i++) { pixmap = gnome_pixmap_new_from_xpm_d(anim[i]); gnome_animator_append_frame_from_gnome_pixmap( GNOME_ANIMATOR(animator),GNOME_PIXMAP(pixmap), 0,0,50); } gnome_animator_set_loop_type(GNOME_ANIMATOR(animator), GNOME_ANIMATOR_LOOP_RESTART); gnome_animator_start(GNOME_ANIMATOR(animator)); return(animator); }