[swell-foop/arnaudb/wip/gtk4: 15/28] Fixed removed container and dialog methods
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [swell-foop/arnaudb/wip/gtk4: 15/28] Fixed removed container and dialog methods
- Date: Mon, 20 Jul 2020 15:31:22 +0000 (UTC)
commit ace449a2e1e58f186938c946fc802b7314be32e7
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 73f9eca..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.add (stack);
+ main_box.append (stack);
}
else
{
- main_box.add (view);
+ 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]