[lightsoff/wip/gtkview] Wait on completion until the buttons disappear



commit 6433ec4b8a3d981428bed268ff5f1ec9bb734998
Author: Robert Roth <robert roth off gmail com>
Date:   Sun Jul 15 15:59:23 2018 +0300

    Wait on completion until the buttons disappear

 src/game-view-gtk.vala | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/src/game-view-gtk.vala b/src/game-view-gtk.vala
index ecf65ed..0b49db2 100644
--- a/src/game-view-gtk.vala
+++ b/src/game-view-gtk.vala
@@ -36,7 +36,6 @@ public class GtkGameView : Gtk.Stack, GameView {
         add_named (new_board as Gtk.Widget, new_level);
         set_visible_child (new_board as Gtk.Widget);
         notify["transition-running"].connect(() => remove (old_board as Gtk.Widget));
-        ;
     }
 
     public void hide_cursor ()
@@ -72,7 +71,7 @@ public class GtkGameView : Gtk.Stack, GameView {
     {
         var view = new BoardViewGtk ();
         view.load_level (level);
-        view.game_won.connect (game_won_cb);
+        view.game_won.connect (() => GLib.Timeout.add (300, game_won_cb));
         view.light_toggled.connect (light_toggled_cb);
         view.playable = false;
         view.show_all ();
@@ -86,14 +85,14 @@ public class GtkGameView : Gtk.Stack, GameView {
 
 // The player won the game; create a new board, update the level count,
     // and transition between the two boards in a random direction.
-    private void game_won_cb ()
+    private bool game_won_cb ()
     {
         current_level++;
-
         new_board_view = create_board_view (current_level);
         replace_board (board_view, new_board_view, GameView.ReplaceStyle.SLIDE_NEXT, false);
         board_view = new_board_view;
         level_changed (current_level);
+        return false;
     }
 
-}
+}
\ No newline at end of file


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]