Re: using cluttermm

On Thu, 2011-09-01 at 10:35 +0200, Krzesimir Nowak wrote:
> 2011/9/1 Ian Martin <ian_martin65 yahoo com au>:
> > Hi,
> > I'm struggling with cluttermm.  The programming with cluttermm book has some
> > deprecated bits, most of which I can figure out (and once I've got there,
> > I'll figure out how to update it).  Currently I can't give an animation a
> > path; the actor.path(x, y) function no longer exists, but adding a path to
> > an Animator with
> > effect->bind("x", 150.0);
> > gives a compile time error:
> > /usr/local/include/cluttermm-1.0/cluttermm/animation.h:238:27: note:
> > Glib::RefPtr<Clutter::Animation> Clutter::Animation::bind(const string&,
> > const Glib::ValueBase&)
> > If I create it with
> >     Glib::Value< float> xdim;
> >      xdim.set(150.0);
> >      effect->bind("x", xdim);
> >    it compiles fine, but on running breaks with output to the terminal:
> > Clutter-WARNING **: Cannot bind property 'x': the interval value of type
> > '(null)' is not compatible with the property value of type 'gfloat'
> Glib::Value is not nice to use as one might wish. Maybe try
> initializing it before:
> Glib::Value<float> xdim;
> xdim.init (xdim.value_type ());
> xdim.set (150.0);
> effect->bind("x", xdim);

Clutter::Animation::bind(const string&, const Glib::ValueBase&)
should have a templated overload like this:
Clutter::Animation::bind(const string&, T_Value& value)
so you can just do:
effect->bind("x", 150.0f);

There is already a TODO comment about this:

Gtk::TreeRow::set_value() is similar:
though this will need slightly different cleverness to init the Value,
like so:

I have CCed Chris Kuehl, the cluttermmm maintainer.

murrayc murrayc com

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]