Mercurial > boomslang
comparison pyntnclick/widgets/game.py @ 602:1aac5a3b17e1 pyntnclick
Remove anything that has to do with focus (hopefully not breaking anything)
author | Stefano Rivera <stefano@rivera.za.net> |
---|---|
date | Sat, 11 Feb 2012 20:05:22 +0200 |
parents | b7d8b89de71a |
children |
comparison
equal
deleted
inserted
replaced
601:0ae62d824d2f | 602:1aac5a3b17e1 |
---|---|
9 class GameWidget(Widget): | 9 class GameWidget(Widget): |
10 def __init__(self, world, offset=(0, 0)): | 10 def __init__(self, world, offset=(0, 0)): |
11 self.world = world | 11 self.world = world |
12 rect = Rect(offset, world.get_size()) | 12 rect = Rect(offset, world.get_size()) |
13 super(GameWidget, self).__init__(rect) | 13 super(GameWidget, self).__init__(rect) |
14 self.focussable = True | |
15 self.add_callback(FlipArrowsEvent, self.flip_arrows) | 14 self.add_callback(FlipArrowsEvent, self.flip_arrows) |
16 | 15 |
17 def flip_arrows(self, ev, widget): | 16 def flip_arrows(self, ev, widget): |
18 self.world.level.flip_arrows() | 17 self.world.level.flip_arrows() |
19 | 18 |
21 self.world.update() | 20 self.world.update() |
22 self.world.draw(surface) | 21 self.world.draw(surface) |
23 | 22 |
24 def restart(self): | 23 def restart(self): |
25 self.world.restart() | 24 self.world.restart() |
26 self.grab_focus() |