From 5974cfc97be14bed6aade7f6e85622d3f72e138f Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 31 Jan 2012 16:30:05 +0000 Subject: [PATCH] docs: Add an example to the Actor description --- clutter/clutter-actor.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index 4eff0c2a6..ac8da2095 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -71,6 +71,27 @@ * will hold a reference on each child actor, which will be released when * the child is removed from its parent, or destroyed using * clutter_actor_destroy(). + * + * ClutterActor *actor = clutter_actor_new (); + * + * /* set the bounding box of the actor */ + * clutter_actor_set_position (actor, 0, 0); + * clutter_actor_set_size (actor, 480, 640); + * + * /* set the background color of the actor */ + * clutter_actor_set_background_color (actor, CLUTTER_COLOR_Orange); + * + * /* set the bounding box of the child, relative to the parent */ + * ClutterActor *child = clutter_actor_new (); + * clutter_actor_set_position (child, 20, 20); + * clutter_actor_set_size (child, 80, 240); + * + * /* set the background color of the child */ + * clutter_actor_set_background_color (child, CLUTTER_COLOR_Blue); + * + * /* add the child to the actor */ + * clutter_actor_add_child (actor, child); + * * Children can be inserted at a given index, or above and below * another child actor. The order of insertion determines the order of the * children when iterating over them. Iterating over children is performed