diff options
author | Carlos Carvallo <carloscarvallo87@gmail.com> | 2013-04-09 16:22:48 (GMT) |
---|---|---|
committer | Carlos Carvallo <carloscarvallo87@gmail.com> | 2013-04-09 16:22:48 (GMT) |
commit | 33f53fcecc039647bd156cbff0a6a09cbc7a83e0 (patch) | |
tree | 13b7dd8b6bede9a44806267438e0cc1a2edf2296 /V2-1barrido.py | |
parent | b41e2f86f8c1b7ab9645a975af3d9adfc2a53d3c (diff) |
Barrido con ventana ajustada con relacion a la pantalla
Diffstat (limited to 'V2-1barrido.py')
-rwxr-xr-x | V2-1barrido.py | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/V2-1barrido.py b/V2-1barrido.py index f4b6731..70d4948 100755 --- a/V2-1barrido.py +++ b/V2-1barrido.py @@ -3,14 +3,19 @@ import gtk, gobject DELAY = 5 DELTA = 1 -WIDTH = 453 -HEIGHT = 453 +#WIDTH = 500 +#HEIGHT = 500 class DrawingArea: def __init__(self): - - window = gtk.Window() - window.set_default_size(WIDTH, HEIGHT) + #window = gtk.Window() + window = gtk.Window(gtk.WINDOW_POPUP) + window.set_modal(True) + screen = window.get_screen() + self.WIDTH = screen.get_width() + self.HEIGHT = screen.get_height() + #window.set_size_request(WIDTH, HEIGHT) + window.set_default_size(self.WIDTH, self.HEIGHT) self.DELTA_X = DELTA self.DELTA_Y = DELTA @@ -52,10 +57,10 @@ class DrawingArea: if orientation == "VERTICAL": - self.drawingarea.window.draw_line(self.gc, line_index, 0, self._x, HEIGHT) + self.drawingarea.window.draw_line(self.gc, line_index, 0, self._x, self.HEIGHT) else: - self.drawingarea.window.draw_line(self.gc, 0, line_index, WIDTH, self._y) + self.drawingarea.window.draw_line(self.gc, 0, line_index, self.WIDTH, self._y) self.drawingarea.queue_draw() @@ -63,7 +68,7 @@ class DrawingArea: # Mover el indice x para que aparente movimiento self._x += self.DELTA_X; - if self._x > WIDTH: + if self._x > self.WIDTH: self.DELTA_X *= -1 elif self._x < 0: self.DELTA_X *= -1 @@ -85,7 +90,7 @@ class DrawingArea: # Mover el indice y para que aparente movimiento self._y += self.DELTA_Y; - if self._y > HEIGHT: + if self._y > self.HEIGHT: self.DELTA_Y *= -1 elif self._y < 0: self.DELTA_Y *= -1 |