• Thanks. Corrected in gist.

  • Was not sure how the below pattern would work with something real. It worked fine.

    def test_animate(self, sender = None): def inc(sender, v): self.value(v) cb = CallMeBack(inc, duration = 5.0) # another version def test_animate(self, sender = None): self.alpha = 0 def inc(sender, v): self.value(v) self.alpha = v cb = CallMeBack(inc, duration = 5.0)
  • IIRC, animate is not parsing your python code, it is basically looking at what changed in your object, then interpolating those attribs over time. so trying to use comments wont work like that.

    note that the way you "broke up" the animation is not doing what you think. Animations happen asynchronously, so your second animation is happening at the same time as the first ( if you animate different properties) ir overwriting it (if you are animating the same attribute). Try changing the frame, then changing it back in badk to back calls, and you will see what i mean.

    You should use completion to chain together animations. If you want to do something instantly at the start, that is no different than just setting that param before you start the animation. Note that doing so will effectively cancel animation of that attribute if you are already animating that attribute.

    If you want to change an attribute in the middle of an animation, kick off two animations at the same time, making us of the delay argument..l in this way you could have alpha switch at the halfway point, or even have alpha animating at a different rate. ,

    If you dont like a few lines on animate calls, you should write your own wrapper that takes in a few a functions and chains together an animation.

    for instance, one could envision creating pseudo acceleration by chaining two or three animations, that have different velocities.

Internal error.

Oops! Looks like something went wrong!