Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xV2-1barrido.py23
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