Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorflavio <fdanesse@gmail.com>2012-02-25 17:34:51 (GMT)
committer flavio <fdanesse@gmail.com>2012-02-25 17:34:51 (GMT)
commit489b6d6d9ea29f3d79643ce1e264662b29f3e8d9 (patch)
tree83d808969f5a57d2e98fec22f4bd1e6026230d9f
parent02367bd39d33cee61c799a20ba0ffecb5cdfc872 (diff)
Mejoras de Rendimiento
-rw-r--r--Moonwidgets.py30
1 files changed, 16 insertions, 14 deletions
diff --git a/Moonwidgets.py b/Moonwidgets.py
index f03788f..181c405 100644
--- a/Moonwidgets.py
+++ b/Moonwidgets.py
@@ -123,7 +123,7 @@ class CalendarButton(gtk.EventBox):
if self.dia > 0:
self.actualizar()
- def actualizar(self):
+ def actualizar(self):
if self.dia <= 0: return
self.image_pixmap = gtk.gdk.Pixmap(self.window, self.imagen_size, self.imagen_size)
gc = self.image_pixmap.new_gc(foreground=MG.BACKGROUND)
@@ -518,30 +518,32 @@ class MatrizMoonCalendar(gtk.EventBox):
self.mes = None
self.fecha = None
self.hora = None
- self.semanas = None
+ self.semanas = []
self.fixes = []
self.calendarbuttons = []
-
+ self.tamanioboton = 0
self.connect("expose_event", self.repaint)
def repaint(self, widget= None, event= None):
- x,y,w,h= self.get_allocation()
if not self.fixes: return
+ x,y,w,h= self.get_allocation()
anchoboton = w/len(self.fixes[0])
altoboton = h/len(self.fixes)
tamanioboton = min( [anchoboton,altoboton] )
- posy = 0
- for fixed in self.fixes:
- self.fixed.move(fixed, 0, posy)
- posy += tamanioboton
- posx = 0
- for fixed in self.fixes:
- for boton in self.calendarbuttons[self.fixes.index(fixed)]:
- fixed.move(boton, posx, 0)
- boton.repaint(tamanioboton)
- posx += tamanioboton
+ if self.tamanioboton != tamanioboton:
+ self.tamanioboton = tamanioboton
+ posy = 0
+ for fixed in self.fixes:
+ self.fixed.move(fixed, 0, posy)
+ posy += self.tamanioboton
posx = 0
+ for fixed in self.fixes:
+ for boton in self.calendarbuttons[self.fixes.index(fixed)]:
+ fixed.move(boton, posx, 0)
+ boton.repaint(self.tamanioboton)
+ posx += self.tamanioboton
+ posx = 0
def set_mes(self, anio, mes, fecha, hora):
self.anio, self.mes, self.fecha, self.hora = anio, mes, fecha, hora