cookbook: Fix examples
This commit is contained in:
parent
b74c722670
commit
da06f650df
@ -125,12 +125,12 @@ on_x_changed (GObject *gobject,
|
|||||||
GParamSpec *pspec,
|
GParamSpec *pspec,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
gint x_value = 0;
|
gint x_value = 0;
|
||||||
|
|
||||||
/* Round the X coordinate to the nearest pixel */
|
/* Round the X coordinate to the nearest pixel */
|
||||||
x_value = floorf (clutter_actor_get_x (CLUTTER_ACTOR (gobject))) + 0.5;
|
x_value = floorf (clutter_actor_get_x (CLUTTER_ACTOR (gobject))) + 0.5;
|
||||||
|
|
||||||
g_print ("The new X coordinate is '%d' pixels\n", x_value);
|
g_print ("The new X coordinate is '%d' pixels\n", x_value);
|
||||||
}
|
}
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</informalexample>
|
</informalexample>
|
||||||
@ -147,9 +147,7 @@ on_allocation_changed (ClutterActor *actor,
|
|||||||
ClutterAllocationFlags flags,
|
ClutterAllocationFlags flags,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
ClutterActor *actor = CLUTTER_ACTOR (gobject);
|
g_print ("The bounding box is now: (%.2f, %.2f) (%.2f x %.2f)\n",
|
||||||
|
|
||||||
g_print ("The bounding box is now: (%.2f, %.2f) (%.2f x %.2f)\n",
|
|
||||||
clutter_actor_box_get_x (allocation),
|
clutter_actor_box_get_x (allocation),
|
||||||
clutter_actor_box_get_y (allocation),
|
clutter_actor_box_get_y (allocation),
|
||||||
clutter_actor_box_get_width (allocation),
|
clutter_actor_box_get_width (allocation),
|
||||||
@ -243,9 +241,9 @@ void on_paint (ClutterActor *actor, gpointer user_data);
|
|||||||
void
|
void
|
||||||
on_paint (ClutterActor *actor)
|
on_paint (ClutterActor *actor)
|
||||||
{
|
{
|
||||||
do_my_paint (actor);
|
do_my_paint (actor);
|
||||||
|
|
||||||
g_signal_stop_emission_by_name (actor, "paint");
|
g_signal_stop_emission_by_name (actor, "paint");
|
||||||
}
|
}
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</informalexample>
|
</informalexample>
|
||||||
|
Loading…
Reference in New Issue
Block a user