Package dtk :: Package ui :: Module animation :: Class Animation

Class Animation

source code

The animation class used to convenient production special effects.

Instance Methods
 
__init__(self, widgets, property, duration, ranges, interpolator=LinerInterpolator, stop_callback=None)
Initialize Animation class.
source code
 
set_delay(self, delay)
Set the delay time of before the start do effect.
source code
 
start_after(self, time)
Start the animation after the dealy time.
source code
 
start(self)
Start the animation object.
source code
 
stop(self)
stop immediately the animation object
source code
 
__mul__(self, other)
Overload the '*' operator to link two or more animation object.
source code
 
__add__(self, other) source code
Method Details

__init__(self, widgets, property, duration, ranges, interpolator=LinerInterpolator, stop_callback=None)
(Constructor)

source code 

Initialize Animation class.

Parameters:
  • widgets - the widgets apply to this animation. the type of this param is an gtk.Widget or an list of gtk.Widget.
  • property - the gtk.Widget's property used to do effect or an function to change the actual effect.
  • duration - the time of this effect to continued, the unit of time is millisecond
  • ranges - the range of the property's value. the type of this param is an [lower,upper] or ([lower, upper], [lower,upper]), this is decsion by the parameter of the 'widget' or 'widgets'.
  • interpolator - this is an function used to calculate the property value by the current time and value range.
  • stop_callback - the callback when this animation stop.

set_delay(self, delay)

source code 

Set the delay time of before the start do effect.

Parameters:
  • delay - the time of dealy, unit of time is millisecond

start_after(self, time)

source code 

Start the animation after the dealy time. or you can use Animation.set_delay function.

Parameters:
  • time - the time of dealy, unit of time is millisecond

__mul__(self, other)

source code 

Overload the '*' operator to link two or more animation object. the animation's effect is happend parallel.

Parameters:
  • other - the right hand side animation class.
Returns:
the new animation class with the two operator animation's effect.