[glibmm/glibmm-2-60] Properties example: Print the property values



commit 82d41a2d7b2ac2a9ffb15814064bed0053f8ab08
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Sun Jun 30 13:43:35 2019 +0200

    Properties example: Print the property values

 examples/properties/properties_example.cc | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/examples/properties/properties_example.cc b/examples/properties/properties_example.cc
index 0d6c336b..224ce2db 100644
--- a/examples/properties/properties_example.cc
+++ b/examples/properties/properties_example.cc
@@ -74,6 +74,8 @@ main(int, char**)
   p.property_firstname().signal_changed().connect(sigc::ptr_fun(&on_firstname_changed));
   p.property_lastname().signal_changed().connect(sigc::ptr_fun(&on_lastname_changed));
   p.property_age().signal_changed().connect(sigc::ptr_fun(&on_age_changed));
+  std::cout << "Name, age: " << p.property_firstname() << " " << p.property_lastname()
+            << ", " << p.property_age() << std::endl;
 
   // now change the properties and see that the handlers get called
   std::cout << "Changing the properties of 'p'" << std::endl;
@@ -81,6 +83,8 @@ main(int, char**)
   p.property_lastname() = "Doe";
   p.property_age() = 43;
   std::cout << "Done changing the properties of 'p'" << std::endl;
+  std::cout << "Name, age: " << p.property_firstname() << " " << p.property_lastname()
+            << ", " << p.property_age() << std::endl;
 
   return 0;
 }


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