cookbook: Begin porting examples to the new API

Start dropping the usage of deprecated classes and API.
This commit is contained in:
Emmanuele Bassi
2012-01-24 15:01:00 +00:00
parent 75549456fd
commit 1c01554e6a
7 changed files with 68 additions and 60 deletions

View File

@ -326,8 +326,7 @@ cb_button_init (CbButton *self)
priv->child = clutter_box_new (layout);
/* set the parent of the ClutterBox to this instance */
clutter_actor_set_parent (priv->child,
CLUTTER_ACTOR (self));
clutter_actor_add_child (CLUTTER_ACTOR (self), priv->child);
/* add text label to the button; see the ClutterText API docs
* for more information about available properties
@ -337,8 +336,7 @@ cb_button_init (CbButton *self)
"ellipsize", PANGO_ELLIPSIZE_END,
NULL);
clutter_container_add_actor (CLUTTER_CONTAINER (priv->child),
priv->label);
clutter_actor_add_child (priv->child, priv->label);
/* add a ClutterClickAction on this actor, so we can proxy its
* "clicked" signal into a signal from this actor