interactive: Use ClutterActor instead of deprecated classes
This commit is contained in:
parent
8492b17ae2
commit
8f1575b970
@ -212,7 +212,7 @@ test_actors_main (int argc, char *argv[])
|
|||||||
g_free (file);
|
g_free (file);
|
||||||
|
|
||||||
/* create a new group to hold multiple actors in a group */
|
/* create a new group to hold multiple actors in a group */
|
||||||
oh->group = clutter_group_new();
|
oh->group = clutter_actor_new ();
|
||||||
clutter_actor_set_name (oh->group, "Group");
|
clutter_actor_set_name (oh->group, "Group");
|
||||||
g_signal_connect (oh->group, "destroy", G_CALLBACK (on_group_destroy), oh);
|
g_signal_connect (oh->group, "destroy", G_CALLBACK (on_group_destroy), oh);
|
||||||
clutter_actor_add_constraint (oh->group, clutter_align_constraint_new (stage, CLUTTER_ALIGN_BOTH, 0.5));
|
clutter_actor_add_constraint (oh->group, clutter_align_constraint_new (stage, CLUTTER_ALIGN_BOTH, 0.5));
|
||||||
|
@ -85,8 +85,8 @@ test_scrolling_main (int argc, char *argv[])
|
|||||||
* size to be the same as one rectangle, position it in the middle of
|
* size to be the same as one rectangle, position it in the middle of
|
||||||
* the stage and set it to clip its contents to the allocated size
|
* the stage and set it to clip its contents to the allocated size
|
||||||
*/
|
*/
|
||||||
scroll = clutter_group_new ();
|
scroll = clutter_actor_new ();
|
||||||
clutter_container_add_actor (CLUTTER_CONTAINER (stage), scroll);
|
clutter_actor_add_child (stage, scroll);
|
||||||
clutter_actor_set_size (scroll, RECT_WIDTH, RECT_HEIGHT);
|
clutter_actor_set_size (scroll, RECT_WIDTH, RECT_HEIGHT);
|
||||||
clutter_actor_add_constraint (scroll, clutter_align_constraint_new (stage, CLUTTER_ALIGN_BOTH, 0.5));
|
clutter_actor_add_constraint (scroll, clutter_align_constraint_new (stage, CLUTTER_ALIGN_BOTH, 0.5));
|
||||||
clutter_actor_set_clip_to_allocation (scroll, TRUE);
|
clutter_actor_set_clip_to_allocation (scroll, TRUE);
|
||||||
@ -96,8 +96,9 @@ test_scrolling_main (int argc, char *argv[])
|
|||||||
* the dragging ends we check whether we're dragging past the end of
|
* the dragging ends we check whether we're dragging past the end of
|
||||||
* the viewport
|
* the viewport
|
||||||
*/
|
*/
|
||||||
viewport = clutter_box_new (clutter_box_layout_new ());
|
viewport = clutter_actor_new ();
|
||||||
clutter_container_add_actor (CLUTTER_CONTAINER (scroll), viewport);
|
clutter_actor_set_layout_manager (viewport, clutter_box_layout_new ());
|
||||||
|
clutter_actor_add_child (scroll, viewport);
|
||||||
|
|
||||||
/* add dragging capabilities to the viewport; the heavy lifting is
|
/* add dragging capabilities to the viewport; the heavy lifting is
|
||||||
* all done by the DragAction itself, plus the ::drag-end signal
|
* all done by the DragAction itself, plus the ::drag-end signal
|
||||||
@ -117,8 +118,9 @@ test_scrolling_main (int argc, char *argv[])
|
|||||||
|
|
||||||
clutter_color_from_string (&color, rect_color[i]);
|
clutter_color_from_string (&color, rect_color[i]);
|
||||||
|
|
||||||
rectangle[i] = clutter_rectangle_new_with_color (&color);
|
rectangle[i] = clutter_actor_new ();
|
||||||
clutter_container_add_actor (CLUTTER_CONTAINER (viewport), rectangle[i]);
|
clutter_actor_set_background_color (rectangle[i], &color);
|
||||||
|
clutter_actor_add_child (viewport, rectangle[i]);
|
||||||
clutter_actor_set_size (rectangle[i], RECT_WIDTH, RECT_HEIGHT);
|
clutter_actor_set_size (rectangle[i], RECT_WIDTH, RECT_HEIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user