[gtkmm/wip/dboles/Builder-test-cleanups: 3/3] tests/builder: Assign member ptrs @ ctor init list



commit 718f78b8945d2c1e72f68f58db9c7cb16442d3a7
Author: Daniel Boles <dboles src gmail com>
Date:   Sun Nov 24 14:03:40 2019 +0000

    tests/builder: Assign member ptrs @ ctor init list
    
    because now we can, as I added the returning versions of get_widget(),
    so let’s use those for better style. We keep the ones in the ctor body
    that assign the same values, just because we do that to test repeating.

 tests/builder/main.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/tests/builder/main.cc b/tests/builder/main.cc
index df59dbba..46ca6d77 100644
--- a/tests/builder/main.cc
+++ b/tests/builder/main.cc
@@ -108,14 +108,14 @@ class MainWindow : public Gtk::Window
 public:
   MainWindow(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& refBuilder)
   : Gtk::Window(cobject)
+  , m_pDerivedButton(Gtk::Builder::get_widget_derived<DerivedButton>(refBuilder, "derived_button", 
"face-smile"))
+  , m_pStandardButton(refBuilder->get_widget<Gtk::Button>("standard_button"))
   {
     std::cout << "MainWindow::ctor" << std::endl;
 
     // Called twice just to see if two calls affect the ref count.
-    m_pDerivedButton = Gtk::Builder::get_widget_derived<DerivedButton>(refBuilder, "derived_button", 
"face-smile");
     m_pDerivedButton = Gtk::Builder::get_widget_derived<DerivedButton>(refBuilder, "derived_button");
     m_pStandardButton = refBuilder->get_widget<Gtk::Button>("standard_button");
-    m_pStandardButton = refBuilder->get_widget<Gtk::Button>("standard_button");
 
     m_pStandardButton->add_destroy_notify_callback(nullptr, on_managed_button_deleted);
   }


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