2007-08-14 18:10:53 -07:00
|
|
|
import clutter
|
|
|
|
import gtk
|
|
|
|
|
|
|
|
class Spinner (clutter.Texture):
|
|
|
|
|
2008-07-02 03:54:37 -07:00
|
|
|
def __init__(self, glossMgr):
|
2007-08-14 18:10:53 -07:00
|
|
|
clutter.Texture.__init__ (self)
|
|
|
|
|
2008-02-24 12:42:52 -08:00
|
|
|
#Theme me please
|
2008-07-02 03:54:37 -07:00
|
|
|
theme = glossMgr.themeMgr.currentTheme
|
|
|
|
pixbuf = gtk.gdk.pixbuf_new_from_file("themes/%s/spinner.svg" % theme)
|
2007-08-14 18:10:53 -07:00
|
|
|
self.set_pixbuf(pixbuf)
|
2007-08-23 04:50:05 -07:00
|
|
|
|
|
|
|
def start(self):
|
|
|
|
self.timeline = clutter.Timeline(40,20)
|
|
|
|
self.timeline.set_loop(True)
|
|
|
|
alpha = clutter.Alpha(self.timeline, clutter.ramp_inc_func)
|
2008-02-17 03:23:38 -08:00
|
|
|
self.spin_behaviour = clutter.BehaviourRotate( axis=clutter.Z_AXIS , direction=clutter.ROTATE_CW, angle_start=0, angle_end=360, alpha=alpha)
|
2007-11-08 03:41:12 -08:00
|
|
|
self.spin_behaviour.set_center(self.get_width()/2,self.get_height()/2, 0)
|
|
|
|
self.spin_behaviour.apply(self)
|
2007-08-23 04:50:05 -07:00
|
|
|
self.timeline.start()
|
2007-08-14 18:10:53 -07:00
|
|
|
|
2007-08-23 04:50:05 -07:00
|
|
|
def stop(self):
|
|
|
|
self.timeline.stop()
|