[gtkmm] Gtk::AboutDialog: Inherit form Window instead of Dialog



commit 444c4fe18cfc0df7341c27f893dfbaab42eaefc7
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Mon Oct 19 14:45:55 2020 +0200

    Gtk::AboutDialog: Inherit form Window instead of Dialog
    
    GtkAboutDialog now inherits from GtkWindow.

 demos/gtk-demo/example_builder.cc | 14 +++-----------
 demos/gtk-demo/example_glarea.cc  |  4 ++--
 gtk/src/aboutdialog.hg            |  8 ++++----
 3 files changed, 9 insertions(+), 17 deletions(-)
---
diff --git a/demos/gtk-demo/example_builder.cc b/demos/gtk-demo/example_builder.cc
index cebb49d7..3c2f58ce 100644
--- a/demos/gtk-demo/example_builder.cc
+++ b/demos/gtk-demo/example_builder.cc
@@ -78,20 +78,12 @@ void Example_Builder::on_file_quit()
 
 void Example_Builder::on_help_about()
 {
-  static bool firstcall = true;
-
   auto pDialog = m_builder->get_widget<Gtk::AboutDialog>("aboutdialog1");
   if (pDialog)
   {
-    if (firstcall)
-    {
-      // Don't call signal_response().connect() more than once.
-      firstcall = false;
-      pDialog->set_transient_for(*this);
-      pDialog->set_hide_on_close(true);
-      pDialog->signal_response().connect(sigc::hide(sigc::mem_fun(*pDialog, &Gtk::Widget::hide)));
-    }
-    pDialog->show();
+    pDialog->set_transient_for(*this);
+    pDialog->set_hide_on_close(true);
+    pDialog->present();
   }
 }
 
diff --git a/demos/gtk-demo/example_glarea.cc b/demos/gtk-demo/example_glarea.cc
index 49a99add..6254a3d1 100644
--- a/demos/gtk-demo/example_glarea.cc
+++ b/demos/gtk-demo/example_glarea.cc
@@ -75,8 +75,8 @@ Example_GLArea::Example_GLArea() : m_RotationAngles(N_AXIS, 0.0f)
   m_VBox.set_spacing(6);
   set_child(m_VBox);
 
-  m_GLArea.set_hexpand(true);
-  m_GLArea.set_vexpand(true);
+  m_GLArea.set_expand(true);
+  m_GLArea.set_size_request(100, 200);
   m_GLArea.set_auto_render(true);
   m_VBox.append(m_GLArea);
 
diff --git a/gtk/src/aboutdialog.hg b/gtk/src/aboutdialog.hg
index eb57d23b..d919f1fd 100644
--- a/gtk/src/aboutdialog.hg
+++ b/gtk/src/aboutdialog.hg
@@ -20,11 +20,11 @@ _CONFIGINCLUDE(gtkmmconfig.h)
 
 #include <vector>
 
-#include <gtkmm/dialog.h>
+#include <gtkmm/window.h>
 #include <gdkmm/paintable.h>
 
 _DEFS(gtkmm,gtk)
-_PINCLUDE(gtkmm/private/dialog_p.h)
+_PINCLUDE(gtkmm/private/window_p.h)
 
 namespace Gtk
 {
@@ -47,9 +47,9 @@ _WRAP_ENUM(License, GtkLicense, decl_prefix GTKMM_API)
  *
  * @ingroup Dialogs
  */
-class GTKMM_API AboutDialog : public Dialog
+class GTKMM_API AboutDialog : public Window
 {
-  _CLASS_GTKOBJECT(AboutDialog, GtkAboutDialog, GTK_ABOUT_DIALOG, Gtk::Dialog, GtkDialog, , , GTKMM_API)
+  _CLASS_GTKOBJECT(AboutDialog, GtkAboutDialog, GTK_ABOUT_DIALOG, Gtk::Window, GtkWindow, , , GTKMM_API)
   _UNMANAGEABLE
 public:
   _CTOR_DEFAULT()


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