[swell-foop/arnaudb/wip/gtk4: 29/37] 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: 29/37] Fixed removed container and dialog methods
- Date: Mon, 25 May 2020 00:12:44 +0000 (UTC)
commit e00558c4f7ad428b42683dd3944b86f113e5c74d
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 6585b9f..a8c4926 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]