mansrz / pymt

Automatically exported from code.google.com/p/pymt
0 stars 0 forks source link

Animation stops failure #206

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. An error is raised when stopping an complex annimation

What is the expected output? What do you see instead?
the annimation to stop

What version of the product are you using? On what operating system?
pymt 0.4b1, windows xp

Please provide any additional information below.

Tito told me to stop an animation using the widget returned in a
widget.do(anim).     wid = widget.do(anim)

It works great, except when the animation is complex, like anim = anim1 +
anim2 + anim3 + ...

The error returned is : 
  File "C:\eclipse\workspace\touchpy\teste\Main.py", line 23, in touch
    self.widget_returned.stop()
AttributeError: 'NoneType' object has no attribute 'stop'
Exception AttributeError: "'NoneType' object has no attribute 'print_exc'"
in <bound method LoaderPygame.__del__ of <pymt.loader.LoaderPygame object
at 0x024BCD30>> ignored

HERE IS AN SIMPLE EXAMPLE

from pymt import *

class Anyclass():
    def __init__(self):
        self.window = MTWindow()
        self.window.push_handlers(on_touch_down=self.touch)

        self.widget = MTScatterWidget()
        self.window.add_widget(self.widget)

        self.animobj1 = Animation(duration=10, pos=[100,100], type = "delta")
        self.animobj2 = Animation(duration=10, scale=1.1, type = "delta")
        self.animobj = self.animobj1 + self.animobj2 

        self.animated = False
        self.widget_returned = None

    def touch(self,touch):
        if self.animated == False:
            self.animated = True
            self.widget_returned = self.widget.do(self.animobj)
        else:
            self.widget_returned.stop()
            self.animou = False

anyclass = Anyclass()

runTouchApp()

Original issue reported on code.google.com by simbol...@gmail.com on 4 Feb 2010 at 3:44

GoogleCodeExporter commented 9 years ago

Original comment by txprog on 10 Feb 2010 at 10:46

GoogleCodeExporter commented 9 years ago

Original comment by txprog on 1 Jun 2010 at 8:43

GoogleCodeExporter commented 9 years ago
Fixed, the sequence and parallel animations needs more structuring it seems

Original comment by sharath....@gmail.com on 29 Jun 2010 at 7:03

GoogleCodeExporter commented 9 years ago

Original comment by sharath....@gmail.com on 29 Jun 2010 at 7:04