diff options
author | Walter Bender <walter@walter-laptop.(none)> | 2009-12-04 00:45:11 (GMT) |
---|---|---|
committer | Walter Bender <walter@walter-laptop.(none)> | 2009-12-04 00:45:11 (GMT) |
commit | 34702a5769802d537d08d91a2df1c76d5813847d (patch) | |
tree | f6db968832b189831a6df62a791ca5b3409d1a99 | |
parent | 2a6d8c5323be8bda711257c9c35760a5b34fc9fe (diff) |
clear selection at end of game
-rw-r--r-- | window.py | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -176,11 +176,13 @@ def _button_release_cb(win, event, tw): # test to see if the game is over if tw.deck.count-tw.deck.index == 0: if find_a_match(tw) is False: + tw.activity.deck_label.set_text("") tw.activity.status_label.set_text(_("Game over") + \ " (" + \ str(int(tw.total_time)) + \ " " + _("seconds") + ")") gobject.source_remove(tw.timeout_id) + unselect(tw) return True tw.matches += 1 tw.activity.status_label.set_text(_("Match")) @@ -190,20 +192,25 @@ def _button_release_cb(win, event, tw): else: tw.activity.match_label.set_text( _("%d matches") % (tw.matches)) - # reset the timer tw.start_time = gobject.get_current_time() tw.timeout_id = None _counter(tw) - else: tw.activity.status_label.set_text(_("No match")) - tw.clicked = [None, None, None] - for a in tw.selected: - a.hide_card() + unselect(tw) return True # +# unselect the cards +# +def unselect(tw): + tw.clicked = [None, None, None] + for a in tw.selected: + a.hide_card() + + +# # Keypress # def _keypress_cb(area, event, tw): |