diff options
author | Andrés Ambrois <andresambrois@gmail.com> | 2008-07-24 03:00:28 (GMT) |
---|---|---|
committer | Andrés Ambrois <andresambrois@gmail.com> | 2008-07-24 03:00:28 (GMT) |
commit | dc08b0a63060a0a2dc03ac414bbad8480baec87f (patch) | |
tree | 0ac51416b5184b23a3416aebf18358f9f8512720 /activity.py | |
parent | 3c0100b1ffce71f123708d9b30f0d2ad90d48b13 (diff) |
Added Pass and Undo buttons (not shown yet)
Facilities for passing and undoing moves are not
functional yet, so the buttons are not packed.
Diffstat (limited to 'activity.py')
-rwxr-xr-x | activity.py | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/activity.py b/activity.py index 204664c..b5f091a 100755 --- a/activity.py +++ b/activity.py @@ -50,23 +50,32 @@ class PlayGo(Activity): self.info_panel = InfoPanel() #Prepare the main box - self._main_view = gtk.HBox() + self._main_view = gtk.VBox() + + #Prepare the top box + self.top_view = gtk.HBox(False, 10) + self.boardWidget.set_size_request(770, 770) + self.top_view.pack_start(self.boardWidget, False) - #Prepare the left box - self.left_view = gtk.VBox(False) - self.left_view.pack_start(self.boardWidget) self.info_panel = InfoPanel() - self.left_view.pack_start(self.info_panel, False) - #Pack the left view - self._main_view.pack_start(self.left_view) - - #Prepare the right view - self.right_view = gtk.VBox() + self.buttons_box = gtk.VBox() + #Pass button + self.pass_button = gtk.Button(_('Pass')) + self.pass_button.connect("clicked", self.pass_cb) +# self.buttons_box.pack_start(self.pass_button, False, False, 10) - #Pack the right view - self._main_view.pack_end(self.right_view, False) + #Undo button + self.undo_button = gtk.Button(_('Undo')) + self.pass_button.connect("clicked", self.undo_cb) +# self.buttons_box.pack_start(self.undo_button, False, False, 10) + self.top_view.pack_start(self.buttons_box, False) + + #Pack the top box and the InfoPanel into the main box + self._main_view.pack_start(self.top_view) + self._main_view.pack_start(self.info_panel) + #Set canvas and show all self.set_canvas(self._main_view) self.show_all() @@ -104,6 +113,12 @@ class PlayGo(Activity): self.connect('key-press-event', self.key_press_cb) + def pass_cb(self, widget, data=None): + self.game.change_turn() + + def undo_cb(self, widget, data=None): + pass + def _get_buddy(self, cs_handle): """Get a Buddy from a channel specific handle.""" # FIXME: After Update.1, design a better API for sugar.presence |