diff options
Diffstat (limited to 'activity.py')
-rwxr-xr-x | activity.py | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/activity.py b/activity.py index d507833..126526f 100755 --- a/activity.py +++ b/activity.py @@ -21,7 +21,7 @@ class ReversiActivity(activity.Activity): def __init__(self, handle): activity.Activity.__init__(self, handle) - self.game = reversi.ReversiController() + self.game = reversi.ReversiController(self) self.build_toolbar() self._pygamecanvas = sugargame.canvas.PygameCanvas(self) self.set_canvas(self._pygamecanvas) @@ -40,6 +40,24 @@ class ReversiActivity(activity.Activity): self.build_colors_toolbar(toolbar_box) separator = gtk.SeparatorToolItem() + toolbar_box.toolbar.insert(separator, -1) + separator.show() + + #current + item = gtk.ToolItem() + label = gtk.Label() + label.set_text(' %s ' % _('Current player:')) + item.add(label) + toolbar_box.toolbar.insert(item, -1) + + #player + item = gtk.ToolItem() + self.current_label = gtk.Label() + self.current_label.set_text(' %s' % 1) + item.add(self.current_label) + toolbar_box.toolbar.insert(item, -1) + + separator = gtk.SeparatorToolItem() separator.props.draw = False separator.set_expand(True) toolbar_box.toolbar.insert(separator, -1) @@ -199,3 +217,6 @@ class ReversiActivity(activity.Activity): b = color.blue *255 / 65535 return (r, g, b) + def set_current_player(self, player): + self.current_label.set_text(' %s' % player) + |