#include static void new_frame_cb (ClutterTimeline *timeline, gint frame_num, ClutterText *text) { gchar *string = g_strdup_printf ("Progress = %lf", clutter_timeline_get_progress (timeline)); clutter_text_set_text (text, string); g_free (string); } static gboolean update_string (gpointer *array) { new_frame_cb (array[0], 0, array[1]); g_free (array); return FALSE; } static void completed_cb (ClutterTimeline *timeline, ClutterText *text) { gpointer *array = g_malloc (sizeof (gpointer) * 2); array[0] = timeline; array[1] = text; g_idle_add ((GSourceFunc)update_string, array); } int main (int argc, char **argv) { ClutterActor *stage, *label; ClutterTimeline *timeline; clutter_init (&argc, &argv); stage = clutter_stage_get_default (); label = clutter_text_new (); clutter_container_add_actor (CLUTTER_CONTAINER (stage), label); timeline = clutter_timeline_new (1000); g_signal_connect (timeline, "new-frame", G_CALLBACK (new_frame_cb), label); g_signal_connect (timeline, "completed", G_CALLBACK (completed_cb), label); clutter_timeline_start (timeline); clutter_actor_show (stage); clutter_main (); return 0; }