self.mode=None
+ # If this is False then animations are forcefully disabled
+ self.do_animations=True
+
def do_realize(self, config):
self.config=config
except TypeError:
do_draw=True
- if do_draw and self.config.getAnimate():
+ if do_draw and self.config.getAnimate() and self.do_animations:
#self.queue_draw()
self.angle_timer_start=time.time()
gobject.timeout_add(20, self.timerAngle)
if do_draw:
self.queue_draw()
-
+
+ def disableAnimation(self):
+ self.do_animations=False
+
+ def enableAnimation(self):
+ self.do_animations=True
+
+ def setAnimationEnable(self, value):
+ if value:
+ self.enableAnimation()
+ else
+ self.disableAnimation()
+
def timerAngle(self):
if self.angle_timer_start==0:
self.angle_timer_start=time.time()-0.05
# self.setMode(o)
class IconGridWidget(IconGrid, gtk.Widget):
- def __init__(self, isconfig, config):
+ def __init__(self, isconfig, config, animation=True):
IconGrid.__init__(self, isconfig)
gtk.Widget.__init__(self)
+ # This must be called before do_realize
+ self.setAnimationEnable(animation)
+
self.config=config
IconGrid.do_realize(self, self.config)
# -----------------------------------------------
# Add the icongrid
- self.igw=IconGridWidget(True, self.config)
+ self.igw=IconGridWidget(True, self.config, False)
# self.igw.do_realize()
# self.igw.setSize(config.getSize())
al=gtk.Alignment(xalign=0, xscale=0)