diff options
author | Pablo Moleri <pmoleri@gmail.com> | 2010-10-15 23:00:31 (GMT) |
---|---|---|
committer | Pablo Moleri <pmoleri@gmail.com> | 2010-10-15 23:00:31 (GMT) |
commit | 21db0b142d7324217fcd02c0176269d065b9ce41 (patch) | |
tree | b0cb97c01d8bcf8beb416d855fce493dd7746afe /Saludame.activity/window.py | |
parent | f3c5dba368c7dccf51f82685457cace526c3274c (diff) |
Clock Widget added.
Subtle modifications in Window.
Diffstat (limited to 'Saludame.activity/window.py')
-rwxr-xr-x | Saludame.activity/window.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Saludame.activity/window.py b/Saludame.activity/window.py index 667e5e3..2ca4d4f 100755 --- a/Saludame.activity/window.py +++ b/Saludame.activity/window.py @@ -14,7 +14,7 @@ class Window: # Una ventana contiene 'n' widgets - def __init__(self, container, rect, frame_rate, windows_controller, bg_color=(0, 0, 0)): + def __init__(self, container, rect, frame_rate, windows_controller, bg_color=None): self.container = container self.rect = pygame.Rect(container.left + rect.left, container.top + rect.top, rect.width, rect.height) # Relativo al container self.frame_rate = frame_rate @@ -52,8 +52,8 @@ class Window: if self.repaint: # Solo actualizamos el fondo de la ventana cuando hagamos un 'repaint' # De otra forma solo actualizamos los widgets y subventanas - - screen.fill(self.bg_color, self.rect) + if self.bg_color: + screen.fill(self.bg_color, self.rect) if self.bg_image != None: screen.blit(self.bg_image, self.rect) # Pintamos el "fondo" de la ventana @@ -62,14 +62,14 @@ class Window: self.repaint = False - for widget in self.widgets: - if (frames % widget.frame_rate == 0): - changes.append(widget.draw(screen)) # Pintamos los widgets que "contiene" la ventana - for win in self.windows: if (frames % win.frame_rate == 0): changes.extend(win.draw(screen, frames)) # Le decimos a cada ventana que se pinte - + + for widget in self.widgets: + if (frames % widget.frame_rate == 0): + changes.append(widget.draw(screen)) # Pintamos los widgets que "contiene" la ventana + return changes def add_child(self, widget): |