From 081ca9948febebce225a7169715d9bbcc13831b2 Mon Sep 17 00:00:00 2001 From: Cristhofer Travieso Date: Tue, 30 Apr 2013 22:06:18 +0000 Subject: Add the fuction _get_route Signed-off-by: Cristhofer Travieso --- diff --git a/game.py b/game.py index dfc5153..82c276c 100644 --- a/game.py +++ b/game.py @@ -35,11 +35,6 @@ LINE_WIDTH = 12 BACKGROUND_COLOR = (0, 1, 0) class Canvas(Gtk.DrawingArea): - - __gsignals__ = {'cross-added': (GObject.SignalFlags.RUN_FIRST, None, [int]), - 'circle-added': (GObject.SignalFlags.RUN_FIRST, - None, [int])} - def __init__(self): GObject.GObject.__init__(self) @@ -57,4 +52,13 @@ class Canvas(Gtk.DrawingArea): context.set_source_rgb(*BACKGROUND_COLOR) context.fill() + def _get_route(self, direction, pos_x, pos_y): + if direction == 'horizontal': + x = alloc.width + else: + x = alloc.height + + context.rectangle(pos_x, pos_y, x, 50) + context.set_source_rgb(0.803921569, 0.788235294, 0.788235294) + context.fill() -- cgit v0.9.1