Sample Clutter Application
Submitted by Bob Spencer, updated on 16 Dec 2009
This project contains source for a "Hello World" application with simple Clutter animations. It was created to be used as part of the Application Development documentation in the Moblin SDK. The code here is relatively simple and doesn't showcase the many excellent features possible in Clutter-based applications.
Get source, build, run
The application depends on clutter 1.0. This is part of all Moblin images.
$ git clone git://git.moblin.org/moblin-sdk-examples
$ cd moblin-sdk-examples/apps/helloworld
$ ./autogen.sh
$ make
$ ./src/clutter-helloworldCode explained
The project consists of a single source file (src/clutter-helloworld.c), which is ~200 LOC and commented. It can be built on the command-line (independent of the autogen scripts) with:
$ gcc -o clutter-helloworld clutter-helloworld.c `pkg-config --cflags --libs clutter-1.0`The code logic is:
- A clutter actor is created for each letter in the string ("Hello World").
- Each actor as assigned a clutter behavior (rotate on random X, Y, or Z axis).
- Each actor is associated with a timeline and started (rotation begins).