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



commit 50eed6ca695718086db72b68f0650234eba621ba
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 7025c48..2319f10 100644
--- a/src/window.vala
+++ b/src/window.vala
@@ -111,11 +111,11 @@ private class SwellFoopWindow : ApplicationWindow
         {
             var stack = build_first_run_stack ();
             stack.add_named (view, "game");
-            main_box.add (stack);
+            main_box.append (stack);
         }
         else
         {
-            main_box.add (view);
+            main_box.append (view);
             init_keyboard ();
         }
     }
@@ -292,9 +292,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]