On Mon, 2009-09-07 at 02:49 +0200, Pawel Suchanecki wrote:
> Hello,
> 
> I used clutter-tutorial bulit from git on 05/09/09 and got the example
> code  from share/doc/clutter/docs/tutorial/html/animation-example.html
> segfaulted.
> 
> When I run it with clutter-1.0 (git built, on Ubuntu 9.04) it hits segv.

Are you referring to this example?

http://www.openismus.com/documents/clutter_tutorial/0.9/docs/tutorial/html/animation-example.html

If so then this little bit of code is wrong:

ClutterAnimation* animation = 
    clutter_actor_animate_with_alpha (rect, alpha, 
      "x", 150, 
      "y", 150,
      "opacity", 0,
      NULL);

The "x" and "y" properties of ClutterActor are float so they need to be
passed floating point values. Otherwise Clutter loses track of the
variable args and starts reading random memory (hence the seg fault). It
should be something like this:

ClutterAnimation* animation = 
clutter_actor_animate_with_alpha (rect, alpha, 
      "x", 150.0, 
      "y", 150.0,
      "opacity", 0,
      NULL);

(notice the '.0' on the end of the 150s)

Hope that helps.

Regards,
- Neil


-- 
To unsubscribe send a mail to [email protected]

Reply via email to