Skip to content
Browse files

tests: replace the use of deprecated API

  • Loading branch information...
1 parent a697c18 commit 8f20ce6873579edabf163468f132acdff4c59849 @thos thos committed Apr 17, 2012
Showing with 20 additions and 19 deletions.
  1. +19 −18 tests/test-containers.c
  2. +1 −1 tests/test-widgets.c
View
37 tests/test-containers.c
@@ -124,7 +124,7 @@ create_property_editor (GObject *object,
label = mx_label_new_with_text (pspec->name);
clutter_actor_set_width (label, 150);
- clutter_container_add_actor (CLUTTER_CONTAINER (box), label);
+ clutter_actor_add_child (box, label);
if (pspec->value_type == G_TYPE_BOOLEAN)
{
@@ -181,7 +181,7 @@ create_property_editor (GObject *object,
if (value)
{
- clutter_container_add_actor (CLUTTER_CONTAINER (box), value);
+ clutter_actor_add_child (box, value);
return box;
}
else
@@ -224,7 +224,7 @@ create_child_inspector (ClutterActor *button)
"</b>", NULL);
label = mx_label_new_with_text (text);
mx_label_set_use_markup (MX_LABEL (label), TRUE);
- clutter_container_add_actor (CLUTTER_CONTAINER (vbox), label);
+ clutter_actor_add_child (vbox, label);
}
for (i = n_properties - 1; i >= 0; i--)
@@ -234,7 +234,7 @@ create_child_inspector (ClutterActor *button)
editor = create_property_editor (G_OBJECT (meta), properties[i]);
if (editor)
- clutter_container_add_actor (CLUTTER_CONTAINER (vbox), editor);
+ clutter_actor_add_child (vbox, editor);
}
clutter_actor_set_width (vbox, 300);
@@ -271,7 +271,7 @@ change_widget (MxComboBox *box,
if (MX_IS_SCROLLABLE (actor))
{
- clutter_container_add_actor (CLUTTER_CONTAINER (data.scroll), actor);
+ mx_bin_set_child (MX_BIN (data.scroll), actor);
clutter_actor_show (data.scroll);
clutter_actor_hide (data.frame);
}
@@ -292,7 +292,7 @@ change_widget (MxComboBox *box,
/* title */
label = mx_label_new_with_text ("<b>Container Properties</b>");
mx_label_set_use_markup (MX_LABEL (label), TRUE);
- clutter_container_add_actor (CLUTTER_CONTAINER (vbox), label);
+ clutter_actor_add_child (vbox, label);
properties = g_object_class_list_properties (class, &n_properties);
@@ -303,22 +303,22 @@ change_widget (MxComboBox *box,
editor = create_property_editor (G_OBJECT (actor), properties[i]);
if (editor)
- clutter_container_add_actor (CLUTTER_CONTAINER (vbox), editor);
+ clutter_actor_add_child (vbox, editor);
}
if (MX_IS_VIEWPORT (actor) || MX_IS_KINETIC_SCROLL_VIEW (actor))
{
ClutterActor *child, *texture;
gint x, y;
- child = clutter_group_new ();
+ child = clutter_actor_new ();
for (x = 0; x < 10; x++)
for (y = 0; y < 10; y++)
{
texture = clutter_texture_new_from_file ("redhand.png", NULL);
clutter_texture_set_keep_aspect_ratio (CLUTTER_TEXTURE (texture), TRUE);
- clutter_container_add_actor (CLUTTER_CONTAINER (child), texture);
+ clutter_actor_add_child (child, texture);
clutter_actor_set_width (texture, 100);
clutter_actor_set_position (texture, x * 100, y * 100);
@@ -327,11 +327,11 @@ change_widget (MxComboBox *box,
if (MX_IS_KINETIC_SCROLL_VIEW (actor))
{
ClutterActor *viewport = mx_viewport_new ();
- clutter_container_add_actor (CLUTTER_CONTAINER (viewport), child);
+ mx_bin_set_child (MX_BIN (viewport), child);
child = viewport;
}
- clutter_container_add_actor (CLUTTER_CONTAINER (actor), child);
+ mx_bin_set_child (MX_BIN (actor), child);
}
else
{
@@ -369,7 +369,7 @@ change_widget (MxComboBox *box,
}
}
else
- clutter_container_add_actor (CLUTTER_CONTAINER (actor), button);
+ clutter_actor_add_child (actor, button);
if (MX_IS_STACK (actor))
{
@@ -387,7 +387,7 @@ change_widget (MxComboBox *box,
data.inspector = mx_scroll_view_new ();
clutter_actor_set_width (data.inspector, 300);
- clutter_container_add_actor (CLUTTER_CONTAINER (data.inspector), vbox);
+ mx_bin_set_child (MX_BIN (data.inspector), vbox);
mx_table_insert_actor_with_properties (MX_TABLE (data.table), data.inspector,
1, 1,
"x-expand", FALSE,
@@ -525,7 +525,7 @@ create_rotate_box (MxWindow *window)
mx_bin_set_child (MX_BIN (button), icon);
g_signal_connect (button, "clicked",
G_CALLBACK (rotate_left_clicked_cb), window);
- clutter_container_add_actor (CLUTTER_CONTAINER (layout), button);
+ clutter_actor_add_child (layout, button);
/* Create rotate-180 button */
icon = mx_icon_new ();
@@ -535,12 +535,13 @@ create_rotate_box (MxWindow *window)
mx_icon_set_icon_name (MX_ICON (icon2), "object-rotate-right");
mx_icon_set_icon_size (MX_ICON (icon2), 16);
layout2 = mx_box_layout_new ();
- clutter_container_add (CLUTTER_CONTAINER (layout2), icon, icon2, NULL);
+ clutter_actor_add_child (layout2, icon);
+ clutter_actor_add_child (layout2, icon2);
button = mx_button_new ();
mx_bin_set_child (MX_BIN (button), layout2);
g_signal_connect (button, "clicked",
G_CALLBACK (rotate_180_clicked_cb), window);
- clutter_container_add_actor (CLUTTER_CONTAINER (layout), button);
+ clutter_actor_add_child (layout, button);
/* Create rotate-right button */
icon = mx_icon_new ();
@@ -550,7 +551,7 @@ create_rotate_box (MxWindow *window)
mx_bin_set_child (MX_BIN (button), icon);
g_signal_connect (button, "clicked",
G_CALLBACK (rotate_right_clicked_cb), window);
- clutter_container_add_actor (CLUTTER_CONTAINER (layout), button);
+ clutter_actor_add_child (layout, button);
return layout;
}
@@ -590,7 +591,7 @@ startup_cb (MxApplication *application)
"x-fill", FALSE,
"x-align", MX_ALIGN_START,
NULL);
- mx_box_layout_insert_actor (MX_BOX_LAYOUT (box), create_rotate_box (window), 1);
+ clutter_actor_insert_child_at_index (box, create_rotate_box (window), 1);
toolbar = mx_window_get_toolbar (window);
mx_bin_set_child (MX_BIN (toolbar), box);
View
2 tests/test-widgets.c
@@ -458,7 +458,7 @@ startup_cb (MxApplication *application)
"x-fill", FALSE,
"x-align", MX_ALIGN_START,
NULL);
- mx_box_layout_insert_actor (MX_BOX_LAYOUT (box), create_rotate_box (window), 1);
+ clutter_actor_insert_child_at_index (box, create_rotate_box (window), 1);
toolbar = mx_window_get_toolbar (window);
mx_bin_set_child (MX_BIN (toolbar), box);

0 comments on commit 8f20ce6

Please sign in to comment.
Something went wrong with that request. Please try again.