diff options
author | Cristhofer Travieso <cristhofert97@gmail.com> | 2013-06-04 18:07:34 (GMT) |
---|---|---|
committer | Cristhofer Travieso <cristhofert97@gmail.com> | 2013-06-04 18:07:34 (GMT) |
commit | 1126bec1eb9716492584ecac622362b85fd202bf (patch) | |
tree | 60c460b01405493331e94882cec25813f0125605 | |
parent | c46a928d679b137088380d49e0f4426f0906e9eb (diff) |
Add a fixed and set the title
Signed-off-by: Cristhofer Travieso <cristhofert97@gmail.com>
-rw-r--r-- | game.py | 39 | ||||
-rw-r--r-- | window.py | 1 |
2 files changed, 16 insertions, 24 deletions
@@ -32,29 +32,20 @@ LINE_WIDTH = 12 BACKGROUND_COLOR = (0, 1, 0) -class Canvas(Gtk.DrawingArea): - - __gsignals__ = { - 'update': (GObject.SIGNAL_RUN_FIRST, None, [])} +class Canvas(Gtk.Fixed): def __init__(self): - GObject.GObject.__init__(self) - - self.cars = [[100, 100, 50, 50, "horizontal", True]] - self.routes = [(10, "horizontal"), (200, "vertical")] - - self.connect('draw', self._draw_cb) - - self.show_all() - - def _draw_cb(self, widget, context): - #redraw - - self.alloc = self.get_allocation() - - # Background - context.rectangle(0, 0, self.alloc.width, self.alloc.height) - context.set_source_rgb(*BACKGROUND_COLOR) - context.fill() - - #Draw cards + Gtk.Fixed.__init__(self) + + #my cards + card1 = Gtk.Image() + card2 = Gtk.Image() + card3 = Gtk.Image() + + #enemy cards + enemy_card1 = Gtk.Image() + enemy_card2 = Gtk.Image() + enemy_card3 = Gtk.Image() + + #deck + deck = Gtk.Image() @@ -24,5 +24,6 @@ if __name__ == "__main__": window.connect('destroy', lambda w: Gtk.main_quit()) window.add(Canvas()) window.maximize() + window.set_title('Truco') window.show_all() Gtk.main() |