[clutter] interactive/snap-constaint: Modernize code
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter] interactive/snap-constaint: Modernize code
- Date: Thu, 12 Apr 2012 17:18:29 +0000 (UTC)
commit 0bf500815984255cc133e204a8982063ce46a17d
Author: Emmanuele Bassi <ebassi linux intel com>
Date: Thu Apr 12 17:08:33 2012 +0100
interactive/snap-constaint: Modernize code
tests/interactive/test-snap-constraint.c | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/tests/interactive/test-snap-constraint.c b/tests/interactive/test-snap-constraint.c
index e36350c..6a492d1 100644
--- a/tests/interactive/test-snap-constraint.c
+++ b/tests/interactive/test-snap-constraint.c
@@ -21,18 +21,20 @@ test_snap_constraint_main (int argc,
g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
/* first layer, with a fixed (100, 25) size */
- layer_a = clutter_rectangle_new_with_color (CLUTTER_COLOR_ScarletRed);
+ layer_a = clutter_actor_new ();
+ clutter_actor_set_background_color (layer_a, CLUTTER_COLOR_ScarletRed);
clutter_actor_set_name (layer_a, "layerA");
- clutter_container_add_actor (CLUTTER_CONTAINER (stage), layer_a);
clutter_actor_set_size (layer_a, 100.0, 25.0);
+ clutter_actor_add_child (stage, layer_a);
/* the first layer is anchored to the middle of the stage */
clutter_actor_add_constraint (layer_a, clutter_align_constraint_new (stage, CLUTTER_ALIGN_BOTH, 0.5));
/* second layer, with no implicit size */
- layer_b = clutter_rectangle_new_with_color (CLUTTER_COLOR_DarkButter);
+ layer_b = clutter_actor_new ();
+ clutter_actor_set_background_color (layer_b, CLUTTER_COLOR_DarkButter);
clutter_actor_set_name (layer_b, "layerB");
- clutter_container_add_actor (CLUTTER_CONTAINER (stage), layer_b);
+ clutter_actor_add_child (stage, layer_b);
/* the second layer tracks the X coordinate and the width of
* the first layer
@@ -57,9 +59,10 @@ test_snap_constraint_main (int argc,
-10.0));
/* the third layer, with no implicit size */
- layer_c = clutter_rectangle_new_with_color (CLUTTER_COLOR_LightChameleon);
+ layer_c = clutter_actor_new ();
+ clutter_actor_set_background_color (layer_c, CLUTTER_COLOR_LightChameleon);
clutter_actor_set_name (layer_c, "layerC");
- clutter_container_add_actor (CLUTTER_CONTAINER (stage), layer_c);
+ clutter_actor_add_child (stage, layer_c);
/* as for the second layer, the third layer tracks the X
* coordinate and width of the first layer
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]