[swell-foop/arnaudb/wip/gtk4: 31/44] Fixed removed container and dialog methods




commit 260cdb98c4c82e6bdd26e204afd2a02ec0d81f89
Author: Robert Roth <robert roth bee-tf ro>
Date:   Thu May 21 12:05:50 2020 +0300

    Fixed removed container and dialog methods

 src/window.vala | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/src/window.vala b/src/window.vala
index f5b18d8..00226d6 100644
--- a/src/window.vala
+++ b/src/window.vala
@@ -114,11 +114,11 @@ private class SwellFoopWindow : ApplicationWindow
         {
             var stack = build_first_run_stack ();
             stack.add_named (view, "game");
-            main_box.pack_start (stack, true, true);
+            main_box.append (stack);
         }
         else
         {
-            main_box.pack_start (view, true, true);
+            main_box.append (view);
             init_keyboard ();
         }
     }
@@ -295,9 +295,14 @@ private class SwellFoopWindow : ApplicationWindow
         /* Translators: text of one of the two buttons of a Dialog that appears if you start a new game 
while one is running; the other is “_Cancel” */
         dialog.add_button (_("_New Game"),  ResponseType.YES);
 
-        var result = dialog.run ();
-        dialog.destroy ();
+        dialog.present ();
+        dialog.response.connect (on_confirmation_response);
+
+    }
 
+    private inline void on_confirmation_response (Gtk.Widget dialog, int result)
+    {
+        dialog.destroy ();
         if (result == ResponseType.YES)
             new_game ();
     }


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