From 33f53fcecc039647bd156cbff0a6a09cbc7a83e0 Mon Sep 17 00:00:00 2001 From: Carlos Carvallo Date: Tue, 09 Apr 2013 16:22:48 +0000 Subject: Barrido con ventana ajustada con relacion a la pantalla --- 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 -- cgit v0.9.1