Hi again,

On 11/7/07, Emmanuele Bassi <[EMAIL PROTECTED]> wrote:
>
> hi;
>
> On Wed, 2007-11-07 at 21:19 +0100, Johan Mårtenson wrote:
>
> > def key_event(stage, event):
> >     timeline = clutter.Timeline(100, 26)
> >     alpha = clutter.Alpha(timeline, clutter.sine_func )
> >
> >     path_forward = clutter.BehaviourPath(alpha, ((0, 0), (100, 100)))
> >
> >     # Up
> >     if event.keyval == 65362:
> >         menu = stage.get_nth_child(0)
> >         path_forward.apply(menu)
> >
> >         timeline.start ()
>
> the timeline, alpha and path_forward objects go out of scope when
> control reaches the end of the key_event signal handler; hence, you see
> no behaviour running because python will simply garbage collect those
> objects.


I  forgot about that, thanks.

you should either declare path_forward as a global variable or, going
> down the object oriented path, as an instance member of your application
> class.


And indeed you're right. Just making the variables global fixes it.

ciao,
> Emmanuele.


Thanks,

 Johan

--
> Emmanuele Bassi, OpenedHand Ltd.
> Unit R, Homesdale Business Centre
> 216-218 Homesdale Rd., Bromley - BR12QZ
> http://www.o-hand.com
>
> --
> To unsubscribe send a mail to [EMAIL PROTECTED]
>
>

Reply via email to