[gtkmm-documentation] buildapp: Update description of Gtk::Window::set_application()
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm-documentation] buildapp: Update description of Gtk::Window::set_application()
- Date: Thu, 14 Nov 2019 17:43:35 +0000 (UTC)
commit 867865f6f6f1f44095d050de5296e3042154f4da
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date: Thu Nov 14 18:41:24 2019 +0100
buildapp: Update description of Gtk::Window::set_application()
* examples/book/buildapp/step[1,2,4,5]/exampleapplication.cc: Update the
comment in create_appwindow() that describes Gtk::Application::add_window()
and Gtk::Window::set_application(). Now they behave the same
as a result of issue gtkmm#56.
examples/book/buildapp/step1/exampleapplication.cc | 9 ++++-----
examples/book/buildapp/step2/exampleapplication.cc | 9 ++++-----
examples/book/buildapp/step4/exampleapplication.cc | 9 ++++-----
examples/book/buildapp/step5/exampleapplication.cc | 9 ++++-----
4 files changed, 16 insertions(+), 20 deletions(-)
---
diff --git a/examples/book/buildapp/step1/exampleapplication.cc
b/examples/book/buildapp/step1/exampleapplication.cc
index c68b209..14a56c9 100644
--- a/examples/book/buildapp/step1/exampleapplication.cc
+++ b/examples/book/buildapp/step1/exampleapplication.cc
@@ -33,11 +33,10 @@ ExampleAppWindow* ExampleApplication::create_appwindow()
// Make sure that the application runs for as long this window is still open.
add_window(*appwindow);
- // Gtk::Application::add_window() connects a signal handler to the window's
- // signal_hide(). That handler removes the window from the application.
- // If it's the last window to be removed, the application stops running.
- // Gtk::Window::set_application() does not connect a signal handler, but is
- // otherwise equivalent to Gtk::Application::add_window().
+ // A window can be added to an application with Gtk::Application::add_window()
+ // or Gtk::Window::set_application(). When all added windows have been hidden
+ // or removed, the application stops running (Gtk::Application::run() returns()),
+ // unless Gio::Application::hold() has been called.
// Delete the window when it is hidden.
appwindow->signal_hide().connect(sigc::bind(sigc::mem_fun(*this,
diff --git a/examples/book/buildapp/step2/exampleapplication.cc
b/examples/book/buildapp/step2/exampleapplication.cc
index fa1cc0c..11754be 100644
--- a/examples/book/buildapp/step2/exampleapplication.cc
+++ b/examples/book/buildapp/step2/exampleapplication.cc
@@ -35,11 +35,10 @@ ExampleAppWindow* ExampleApplication::create_appwindow()
// Make sure that the application runs for as long this window is still open.
add_window(*appwindow);
- // Gtk::Application::add_window() connects a signal handler to the window's
- // signal_hide(). That handler removes the window from the application.
- // If it's the last window to be removed, the application stops running.
- // Gtk::Window::set_application() does not connect a signal handler, but is
- // otherwise equivalent to Gtk::Application::add_window().
+ // A window can be added to an application with Gtk::Application::add_window()
+ // or Gtk::Window::set_application(). When all added windows have been hidden
+ // or removed, the application stops running (Gtk::Application::run() returns()),
+ // unless Gio::Application::hold() has been called.
// Delete the window when it is hidden.
appwindow->signal_hide().connect(sigc::bind(sigc::mem_fun(*this,
diff --git a/examples/book/buildapp/step4/exampleapplication.cc
b/examples/book/buildapp/step4/exampleapplication.cc
index 4e08d47..706331a 100644
--- a/examples/book/buildapp/step4/exampleapplication.cc
+++ b/examples/book/buildapp/step4/exampleapplication.cc
@@ -35,11 +35,10 @@ ExampleAppWindow* ExampleApplication::create_appwindow()
// Make sure that the application runs for as long this window is still open.
add_window(*appwindow);
- // Gtk::Application::add_window() connects a signal handler to the window's
- // signal_hide(). That handler removes the window from the application.
- // If it's the last window to be removed, the application stops running.
- // Gtk::Window::set_application() does not connect a signal handler, but is
- // otherwise equivalent to Gtk::Application::add_window().
+ // A window can be added to an application with Gtk::Application::add_window()
+ // or Gtk::Window::set_application(). When all added windows have been hidden
+ // or removed, the application stops running (Gtk::Application::run() returns()),
+ // unless Gio::Application::hold() has been called.
// Delete the window when it is hidden.
appwindow->signal_hide().connect(sigc::bind(sigc::mem_fun(*this,
diff --git a/examples/book/buildapp/step5/exampleapplication.cc
b/examples/book/buildapp/step5/exampleapplication.cc
index 75e16c1..e2a9324 100644
--- a/examples/book/buildapp/step5/exampleapplication.cc
+++ b/examples/book/buildapp/step5/exampleapplication.cc
@@ -36,11 +36,10 @@ ExampleAppWindow* ExampleApplication::create_appwindow()
// Make sure that the application runs for as long this window is still open.
add_window(*appwindow);
- // Gtk::Application::add_window() connects a signal handler to the window's
- // signal_hide(). That handler removes the window from the application.
- // If it's the last window to be removed, the application stops running.
- // Gtk::Window::set_application() does not connect a signal handler, but is
- // otherwise equivalent to Gtk::Application::add_window().
+ // A window can be added to an application with Gtk::Application::add_window()
+ // or Gtk::Window::set_application(). When all added windows have been hidden
+ // or removed, the application stops running (Gtk::Application::run() returns()),
+ // unless Gio::Application::hold() has been called.
// Delete the window when it is hidden.
appwindow->signal_hide().connect(sigc::bind(sigc::mem_fun(*this,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]