[clutter] docs: Add an example to the Actor description
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter] docs: Add an example to the Actor description
- Date: Tue, 31 Jan 2012 16:48:42 +0000 (UTC)
commit 5974cfc97be14bed6aade7f6e85622d3f72e138f
Author: Emmanuele Bassi <ebassi linux intel com>
Date: Tue Jan 31 16:30:05 2012 +0000
docs: Add an example to the Actor description
clutter/clutter-actor.c | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c
index 4eff0c2..ac8da20 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().</para>
+ * <informalexample><programlisting>
+ * 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);
+ * </programlisting></informalexample>
* <para>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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]