[gtkmm-documentation] C++11: More use of auto.



commit e0334de59a615208b3aa9466519eecc587a27082
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Jul 23 12:22:15 2015 +0200

    C++11: More use of auto.

 examples/book/actionbar/examplewindow.cc           |    4 +-
 examples/book/actionbar/main.cc                    |    2 +-
 examples/book/alignment/main.cc                    |    2 +-
 .../app_and_win_menus/exampleapplication.cc        |   18 ++++++------
 .../application/app_and_win_menus/examplewindow.cc |    2 +-
 .../book/application/app_and_win_menus/main.cc     |    2 +-
 .../command_line_handling/exampleapplication.cc    |    8 +++---
 .../command_line_handling/examplewindow.cc         |    2 +-
 .../book/application/command_line_handling/main.cc |    2 +-
 .../book/application/simple/exampleapplication.cc  |    4 +-
 examples/book/application/simple/examplewindow.cc  |    2 +-
 examples/book/application/simple/main.cc           |    2 +-
 examples/book/aspectframe/main.cc                  |    2 +-
 examples/book/assistant/main.cc                    |    2 +-
 examples/book/base/base.cc                         |    2 +-
 examples/book/box/main.cc                          |    4 +-
 examples/book/builder/basic/main.cc                |    4 +-
 examples/book/builder/derived/main.cc              |    4 +-
 examples/book/buttonbox/main.cc                    |    2 +-
 examples/book/buttons/button/main.cc               |    2 +-
 examples/book/buttons/checkbutton/main.cc          |    2 +-
 examples/book/buttons/filechooserbutton/main.cc    |    2 +-
 examples/book/buttons/radiobutton/main.cc          |    2 +-
 examples/book/buttons/scalebutton/main.cc          |    2 +-
 examples/book/buttons/togglebutton/main.cc         |    2 +-
 examples/book/buttons/volumebutton/main.cc         |    2 +-
 examples/book/clipboard/ideal/examplewindow.cc     |    6 ++--
 examples/book/clipboard/ideal/main.cc              |    2 +-
 examples/book/clipboard/simple/examplewindow.cc    |    4 +-
 examples/book/clipboard/simple/main.cc             |    2 +-
 examples/book/combobox/complex/main.cc             |    2 +-
 .../book/combobox/entry_complex/examplewindow.cc   |    8 +++---
 examples/book/combobox/entry_complex/main.cc       |    2 +-
 examples/book/combobox/entry_text/examplewindow.cc |    2 +-
 examples/book/combobox/entry_text/main.cc          |    2 +-
 examples/book/combobox/text/main.cc                |    2 +-
 examples/book/custom/custom_container/main.cc      |    2 +-
 examples/book/custom/custom_widget/main.cc         |    2 +-
 examples/book/custom/custom_widget/mywidget.cc     |    2 +-
 examples/book/dialogs/aboutdialog/main.cc          |    2 +-
 examples/book/dialogs/colorchooserdialog/main.cc   |    2 +-
 .../dialogs/filechooserdialog/examplewindow.cc     |    6 ++--
 examples/book/dialogs/filechooserdialog/main.cc    |    2 +-
 examples/book/dialogs/fontchooserdialog/main.cc    |    2 +-
 examples/book/dialogs/messagedialog/main.cc        |    2 +-
 examples/book/dialogs/simple/main.cc               |    2 +-
 examples/book/drag_and_drop/main.cc                |    2 +-
 examples/book/drawingarea/arcs/main.cc             |    2 +-
 examples/book/drawingarea/clock/clock.cc           |    2 +-
 examples/book/drawingarea/clock/main.cc            |    2 +-
 examples/book/drawingarea/curve/main.cc            |    2 +-
 examples/book/drawingarea/image/main.cc            |    2 +-
 examples/book/drawingarea/joins/main.cc            |    2 +-
 examples/book/drawingarea/joins/myarea.cc          |    2 +-
 examples/book/drawingarea/pango_text/main.cc       |    2 +-
 examples/book/drawingarea/pango_text/myarea.cc     |    2 +-
 examples/book/drawingarea/simple/main.cc           |    2 +-
 examples/book/drawingarea/thin_lines/main.cc       |    2 +-
 examples/book/drawingarea/thin_lines/myarea.cc     |    2 +-
 examples/book/entry/completion/examplewindow.cc    |    4 +-
 examples/book/entry/completion/main.cc             |    2 +-
 examples/book/entry/icon/main.cc                   |    2 +-
 examples/book/entry/progress/main.cc               |    2 +-
 examples/book/entry/simple/main.cc                 |    2 +-
 examples/book/eventbox/main.cc                     |    2 +-
 examples/book/expander/main.cc                     |    2 +-
 examples/book/flowbox/examplewindow.cc             |    6 ++--
 examples/book/flowbox/main.cc                      |    2 +-
 examples/book/frame/main.cc                        |    2 +-
 examples/book/giomm/directory_list/main.cc         |    6 ++--
 examples/book/giomm/getline/getline.cc             |    6 ++--
 .../giomm/monitor_directory/monitor_directory.cc   |   10 +++---
 examples/book/giomm/read_file/main.cc              |    4 +-
 examples/book/giomm/usage/usage.cc                 |    6 ++--
 examples/book/giomm/volumes/main.cc                |    2 +-
 examples/book/giomm/write_file/main.cc             |    2 +-
 examples/book/grid/main.cc                         |    2 +-
 examples/book/headerbar/main.cc                    |    2 +-
 examples/book/helloworld/main.cc                   |    2 +-
 examples/book/helloworld2/main.cc                  |    2 +-
 examples/book/iconview/main.cc                     |    2 +-
 examples/book/idle/idleexample.cc                  |    2 +-
 examples/book/idle/main.cc                         |    2 +-
 examples/book/infobar/examplewindow.cc             |    2 +-
 examples/book/infobar/main.cc                      |    2 +-
 examples/book/keyboard_events/propagation/main.cc  |    2 +-
 examples/book/keyboard_events/simple/main.cc       |    2 +-
 examples/book/label/main.cc                        |    2 +-
 examples/book/listbox/examplewindow.cc             |   17 ++++++-----
 examples/book/listbox/main.cc                      |    2 +-
 .../book/menus/main_menu/exampleapplication.cc     |    8 +++---
 examples/book/menus/main_menu/main.cc              |    2 +-
 examples/book/menus/popup/examplewindow.cc         |    6 ++--
 examples/book/menus/popup/main.cc                  |    2 +-
 examples/book/menus_and_toolbars/examplewindow.cc  |    6 ++--
 examples/book/menus_and_toolbars/main.cc           |    2 +-
 examples/book/multithread/examplewindow.cc         |    6 ++--
 examples/book/multithread/main.cc                  |    2 +-
 examples/book/notebook/main.cc                     |    2 +-
 examples/book/paned/main.cc                        |    2 +-
 examples/book/paned/messagetext.cc                 |    2 +-
 examples/book/placessidebar/examplewindow.cc       |    4 +-
 examples/book/placessidebar/main.cc                |    2 +-
 examples/book/popover/examplewindow.cc             |    4 +-
 examples/book/popover/main.cc                      |    2 +-
 examples/book/printing/advanced/examplewindow.cc   |   14 +++++-----
 examples/book/printing/advanced/main.cc            |    2 +-
 examples/book/printing/advanced/previewdialog.cc   |    4 +-
 .../book/printing/advanced/printformoperation.cc   |    8 +++---
 examples/book/printing/simple/examplewindow.cc     |   14 +++++-----
 examples/book/printing/simple/main.cc              |    2 +-
 .../book/printing/simple/printformoperation.cc     |    2 +-
 examples/book/progressbar/main.cc                  |    2 +-
 examples/book/range_widgets/main.cc                |    2 +-
 examples/book/recent_files/examplewindow.cc        |    6 ++--
 examples/book/recent_files/main.cc                 |    2 +-
 examples/book/revealer/main.cc                     |    2 +-
 examples/book/scrolledwindow/examplewindow.cc      |    2 +-
 examples/book/scrolledwindow/main.cc               |    2 +-
 examples/book/searchbar/main.cc                    |    2 +-
 examples/book/socket/plug.cc                       |    2 +-
 examples/book/socket/socket.cc                     |    6 ++--
 examples/book/spinbutton/main.cc                   |    2 +-
 examples/book/textview/main.cc                     |    2 +-
 examples/book/timeout/main.cc                      |    2 +-
 examples/book/toolbar/examplewindow.cc             |    2 +-
 examples/book/toolbar/main.cc                      |    2 +-
 examples/book/toolpalette/canvas.cc                |   12 ++++----
 examples/book/toolpalette/canvas.h                 |    2 +-
 examples/book/toolpalette/examplewindow.cc         |   18 ++++++------
 examples/book/toolpalette/main.cc                  |    2 +-
 examples/book/tooltips/main.cc                     |    2 +-
 .../book/treeview/combo_renderer/examplewindow.cc  |    4 +-
 examples/book/treeview/combo_renderer/main.cc      |    2 +-
 examples/book/treeview/drag_and_drop/main.cc       |    2 +-
 .../book/treeview/drag_and_drop/treemodel_dnd.cc   |    6 ++--
 .../book/treeview/editable_cells/examplewindow.cc  |    4 +-
 examples/book/treeview/editable_cells/main.cc      |    2 +-
 examples/book/treeview/filter/examplewindow.cc     |    2 +-
 examples/book/treeview/filter/main.cc              |    2 +-
 .../book/treeview/filter_modify/examplewindow.cc   |    2 +-
 examples/book/treeview/filter_modify/main.cc       |    2 +-
 examples/book/treeview/list/examplewindow.cc       |    6 ++--
 examples/book/treeview/list/main.cc                |    2 +-
 examples/book/treeview/listviewtext/main.cc        |    2 +-
 examples/book/treeview/modelsort/main.cc           |    2 +-
 examples/book/treeview/popup/main.cc               |    2 +-
 examples/book/treeview/popup/treeview_withpopup.cc |    4 +-
 examples/book/treeview/tree/main.cc                |    2 +-
 examples/book/update_ui/main.cc                    |    2 +-
 examples/others/arrow/arrow.cc                     |    2 +-
 examples/others/calendar/calendar.cc               |   28 ++++++++++----------
 .../others/cellrenderercustom/cellrendererlist.cc  |    2 +-
 .../cellrenderercustom/cellrenderertoggle.cc       |    2 +-
 examples/others/cellrenderercustom/testpopup.cc    |    2 +-
 examples/others/dnd/dndwindow.cc                   |    6 ++--
 examples/others/dnd/main.cc                        |    2 +-
 examples/others/exception/exceptiontest.cc         |    2 +-
 examples/others/idle/idle.cc                       |    2 +-
 examples/others/statusbar/statusbar.cc             |    2 +-
 examples/others/tictactoe/tictactoe.cc             |    2 +-
 examples/others/tictactoe/ttt_test.cc              |    4 +-
 .../others/treemodelcustom/exampletreemodel.cc     |   12 ++++----
 examples/others/treemodelcustom/main.cc            |    2 +-
 examples/others/window/wheelbarrow.cc              |    4 +-
 165 files changed, 284 insertions(+), 283 deletions(-)
---
diff --git a/examples/book/actionbar/examplewindow.cc b/examples/book/actionbar/examplewindow.cc
index aa19e5e..6027f36 100644
--- a/examples/book/actionbar/examplewindow.cc
+++ b/examples/book/actionbar/examplewindow.cc
@@ -27,7 +27,7 @@ ExampleWindow::ExampleWindow()
   set_default_size(600, 400);
 
   // Prefer dark theme
-  Glib::RefPtr<Gtk::Settings> settings = Gtk::Settings::get_default();
+  auto settings = Gtk::Settings::get_default();
   settings->property_gtk_application_prefer_dark_theme().set_value(true);
 
   // Face
@@ -40,7 +40,7 @@ ExampleWindow::ExampleWindow()
   m_photo_box.pack_start(m_prev_button, Gtk::PACK_SHRINK);
   m_photo_box.pack_start(m_photo_button, Gtk::PACK_SHRINK);
   m_photo_box.pack_start(m_next_button, Gtk::PACK_SHRINK);
-  Glib::RefPtr<Gtk::StyleContext> style_context = m_photo_box.get_style_context();
+  auto style_context = m_photo_box.get_style_context();
   style_context->add_class("raised");
   style_context->add_class("linked");
 
diff --git a/examples/book/actionbar/main.cc b/examples/book/actionbar/main.cc
index 409dcc9..7eb557c 100644
--- a/examples/book/actionbar/main.cc
+++ b/examples/book/actionbar/main.cc
@@ -19,7 +19,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example.actionbar");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example.actionbar");
 
   ExampleWindow window;
 
diff --git a/examples/book/alignment/main.cc b/examples/book/alignment/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/alignment/main.cc
+++ b/examples/book/alignment/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/application/app_and_win_menus/exampleapplication.cc 
b/examples/book/application/app_and_win_menus/exampleapplication.cc
index eaf0e93..2f7254e 100644
--- a/examples/book/application/app_and_win_menus/exampleapplication.cc
+++ b/examples/book/application/app_and_win_menus/exampleapplication.cc
@@ -42,7 +42,7 @@ void ExampleApplication::on_startup()
     sigc::mem_fun(*this, &ExampleApplication::on_action_quit) );
 
   
-  Glib::RefPtr<Gio::Menu> app_menu = Gio::Menu::create();
+  auto app_menu = Gio::Menu::create();
   app_menu->append("_Something", "app.something");
   app_menu->append("_Quit", "app.quit");
 
@@ -50,16 +50,16 @@ void ExampleApplication::on_startup()
 
 
   //Create the per-Window menu:
-  Glib::RefPtr<Gio::Menu> win_menu = Gio::Menu::create();
+  auto win_menu = Gio::Menu::create();
 
-  Glib::RefPtr<Gio::Menu> submenu_file = Gio::Menu::create();
+  auto submenu_file = Gio::Menu::create();
   submenu_file->append("_New", "win.new");
   submenu_file->append("_Close", "win.close");
   win_menu->append_submenu("File", submenu_file);
 
-  Glib::RefPtr<Gio::Menu> submenu_edit = Gio::Menu::create();
+  auto submenu_edit = Gio::Menu::create();
   submenu_edit->append("_Cut", "win.cut");
-  Glib::RefPtr<Gio::MenuItem> item = Gio::MenuItem::create("_Copy", "win.copy");
+  auto item = Gio::MenuItem::create("_Copy", "win.copy");
   //Setting "accel" works, but might be deprecated soon: See 
https://bugzilla.gnome.org/show_bug.cgi?id=708908
   //When it is deprecated, use Gtk::Application::set_accel_for_action() instead.
   item->set_attribute_value("accel", Glib::Variant<Glib::ustring>::create("<Primary>c"));
@@ -69,7 +69,7 @@ void ExampleApplication::on_startup()
   submenu_edit->append_item(item);
   win_menu->append_submenu("Edit", submenu_edit);
 
-  Glib::RefPtr<Gio::Menu> submenu_notification = Gio::Menu::create();
+  auto submenu_notification = Gio::Menu::create();
   submenu_notification->append("_Send", "win.send-note");
   submenu_notification->append("_Withdraw", "win.withdraw-note");
   win_menu->append_submenu("Notification", submenu_notification);
@@ -78,7 +78,7 @@ void ExampleApplication::on_startup()
 
   //Create an action with a parameter. This action can be activated from
   //a Gio::Notification, sent by the Notification/win.send-note menu selection.
-  Glib::RefPtr<Gio::SimpleAction> action_print =
+  auto action_print =
     Gio::SimpleAction::create("print", Glib::VARIANT_TYPE_STRING);
   action_print->signal_activate().connect(
     sigc::mem_fun(*this, &ExampleApplication::on_action_print));
@@ -87,7 +87,7 @@ void ExampleApplication::on_startup()
 
 void ExampleApplication::create_window()
 {
-  ExampleWindow* window = new ExampleWindow();
+  auto window = new ExampleWindow();
   window->set_default_size(300, 100);
 
   //Make sure that the application runs for as long this window is still open:
@@ -132,7 +132,7 @@ void ExampleApplication::on_action_quit()
   // counts in both of them. If we want the destructors to be called, we
   // must remove the window from the application. One way of doing this
   // is to hide the window.
-  std::vector<Gtk::Window*> windows = get_windows();
+  auto windows = get_windows();
   if (windows.size() > 0)
     windows[0]->hide(); // In this simple case, we know there is only one window.
 }
diff --git a/examples/book/application/app_and_win_menus/examplewindow.cc 
b/examples/book/application/app_and_win_menus/examplewindow.cc
index 6a39ee0..2978fc9 100644
--- a/examples/book/application/app_and_win_menus/examplewindow.cc
+++ b/examples/book/application/app_and_win_menus/examplewindow.cc
@@ -58,7 +58,7 @@ void ExampleWindow::on_action_send_notification()
 {
   std::cout << G_STRFUNC << std::endl;
 
-  Glib::RefPtr<Gio::Notification> note = Gio::Notification::create("Unimportant message!");
+  auto note = Gio::Notification::create("Unimportant message!");
   note->set_body("Notification from " + Glib::get_application_name());
   note->add_button("Print", "app.print", Glib::ustring("Hello, world!"));
   note->add_button("Quit Application", "app.quit");
diff --git a/examples/book/application/app_and_win_menus/main.cc 
b/examples/book/application/app_and_win_menus/main.cc
index 21f253b..e9afea5 100644
--- a/examples/book/application/app_and_win_menus/main.cc
+++ b/examples/book/application/app_and_win_menus/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<ExampleApplication> application = 
+  auto application = 
     ExampleApplication::create();
 
   // Start the application, showing the initial window, 
diff --git a/examples/book/application/command_line_handling/exampleapplication.cc 
b/examples/book/application/command_line_handling/exampleapplication.cc
index 4c2c627..40cb055 100644
--- a/examples/book/application/command_line_handling/exampleapplication.cc
+++ b/examples/book/application/command_line_handling/exampleapplication.cc
@@ -58,7 +58,7 @@ Glib::RefPtr<ExampleApplication> ExampleApplication::create()
 
 void ExampleApplication::create_window(const Glib::RefPtr<Gio::File>& file)
 {
-  ExampleWindow* window = new ExampleWindow();
+  auto window = new ExampleWindow();
 
   //Make sure that the application runs for as long this window is still open:
   add_window(*window);
@@ -104,7 +104,7 @@ void ExampleApplication::on_open(const Gio::Application::type_vec_files& files,
   //std::cout << "debug: files.size()=" << files.size() << std::endl;
   for(std::size_t i = 0; i < files.size(); i++)
   {
-    Glib::RefPtr<Gio::File> file = files[i];
+    auto file = files[i];
     if(!file)
     {
       std::cerr << G_STRFUNC << ": file is null." << std::endl;
@@ -128,7 +128,7 @@ static bool get_arg_value(const Glib::RefPtr<Glib::VariantDict>& options, const
   }
   else
   {
-    GVariant* gvariant = g_variant_dict_lookup_value(options->gobj(), arg_name.c_str(), NULL);
+    auto gvariant = g_variant_dict_lookup_value(options->gobj(), arg_name.c_str(), NULL);
     if(!gvariant)
     {
       std::cerr << "The \"" << arg_name << "\" value was not in the options VariantDict." << std::endl;
@@ -146,7 +146,7 @@ static bool get_arg_value(const Glib::RefPtr<Glib::VariantDict>& options, const
 
 int ExampleApplication::on_command_line(const Glib::RefPtr<Gio::ApplicationCommandLine>& command_line)
 {
-  const Glib::RefPtr<Glib::VariantDict> options = command_line->get_options_dict();
+  const auto options = command_line->get_options_dict();
   if(!options)
     std::cerr << G_STRFUNC << ": options is null." << std::endl;
 
diff --git a/examples/book/application/command_line_handling/examplewindow.cc 
b/examples/book/application/command_line_handling/examplewindow.cc
index c3102e2..164ad38 100644
--- a/examples/book/application/command_line_handling/examplewindow.cc
+++ b/examples/book/application/command_line_handling/examplewindow.cc
@@ -41,7 +41,7 @@ bool ExampleWindow::load_file(const Glib::RefPtr<Gio::File>& file)
       if(contents && length)
       {
         const Glib::ustring text(contents);
-        Glib::RefPtr<Gtk::TextBuffer> buffer = m_view.get_buffer();
+        auto buffer = m_view.get_buffer();
         buffer->set_text(text);
       }
       g_free(contents);
diff --git a/examples/book/application/command_line_handling/main.cc 
b/examples/book/application/command_line_handling/main.cc
index 21f253b..e9afea5 100644
--- a/examples/book/application/command_line_handling/main.cc
+++ b/examples/book/application/command_line_handling/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<ExampleApplication> application = 
+  auto application = 
     ExampleApplication::create();
 
   // Start the application, showing the initial window, 
diff --git a/examples/book/application/simple/exampleapplication.cc 
b/examples/book/application/simple/exampleapplication.cc
index 453b2e5..6428fb0 100644
--- a/examples/book/application/simple/exampleapplication.cc
+++ b/examples/book/application/simple/exampleapplication.cc
@@ -31,7 +31,7 @@ Glib::RefPtr<ExampleApplication> ExampleApplication::create()
 
 void ExampleApplication::create_window(const Glib::RefPtr<Gio::File>& file)
 {
-  ExampleWindow* window = new ExampleWindow();
+  auto window = new ExampleWindow();
 
   //Make sure that the application runs for as long this window is still open:
   add_window(*window);
@@ -77,7 +77,7 @@ void ExampleApplication::on_open(const Gio::Application::type_vec_files& files,
   //std::cout << "debug: files.size()=" << files.size() << std::endl;
   for(guint i = 0; i < files.size(); i++)
   {
-    Glib::RefPtr<Gio::File> file = files[i];
+    auto file = files[i];
     if(!file)
     {
       std::cerr << G_STRFUNC << ": file is null." << std::endl;
diff --git a/examples/book/application/simple/examplewindow.cc 
b/examples/book/application/simple/examplewindow.cc
index c3102e2..164ad38 100644
--- a/examples/book/application/simple/examplewindow.cc
+++ b/examples/book/application/simple/examplewindow.cc
@@ -41,7 +41,7 @@ bool ExampleWindow::load_file(const Glib::RefPtr<Gio::File>& file)
       if(contents && length)
       {
         const Glib::ustring text(contents);
-        Glib::RefPtr<Gtk::TextBuffer> buffer = m_view.get_buffer();
+        auto buffer = m_view.get_buffer();
         buffer->set_text(text);
       }
       g_free(contents);
diff --git a/examples/book/application/simple/main.cc b/examples/book/application/simple/main.cc
index 21f253b..e9afea5 100644
--- a/examples/book/application/simple/main.cc
+++ b/examples/book/application/simple/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<ExampleApplication> application = 
+  auto application = 
     ExampleApplication::create();
 
   // Start the application, showing the initial window, 
diff --git a/examples/book/aspectframe/main.cc b/examples/book/aspectframe/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/aspectframe/main.cc
+++ b/examples/book/aspectframe/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/assistant/main.cc b/examples/book/assistant/main.cc
index a46a3c0..54787f4 100644
--- a/examples/book/assistant/main.cc
+++ b/examples/book/assistant/main.cc
@@ -19,7 +19,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/base/base.cc b/examples/book/base/base.cc
index 67ad54f..e085836 100644
--- a/examples/book/base/base.cc
+++ b/examples/book/base/base.cc
@@ -2,7 +2,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app =
+  auto app =
     Gtk::Application::create(argc, argv,
       "org.gtkmm.examples.base");
 
diff --git a/examples/book/box/main.cc b/examples/book/box/main.cc
index 5eb9729..b6bf4b2 100644
--- a/examples/book/box/main.cc
+++ b/examples/book/box/main.cc
@@ -58,7 +58,7 @@ int main(int argc, char *argv[])
   // They are included to show a program with Gio::APPLICATION_HANDLES_COMMAND_LINE.
   // Gio::APPLICATION_NON_UNIQUE makes it possible to run several instances of
   // this application simultaneously.
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv,
+  auto app = Gtk::Application::create(argc, argv,
     "org.gtkmm.example", Gio::APPLICATION_HANDLES_COMMAND_LINE | Gio::APPLICATION_NON_UNIQUE);
 
   // Note after = false.
@@ -69,7 +69,7 @@ int main(int argc, char *argv[])
   // Gio::APPLICATION_NON_UNIQUE makes it possible to run several instances of
   // this application simultaneously.
   int argc1 = 1; // Don't give the command line arguments to Gtk::Application.
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc1, argv,
+  auto app = Gtk::Application::create(argc1, argv,
     "org.gtkmm.example", Gio::APPLICATION_NON_UNIQUE);
 #endif
 
diff --git a/examples/book/builder/basic/main.cc b/examples/book/builder/basic/main.cc
index ef71286..2d62c4b 100644
--- a/examples/book/builder/basic/main.cc
+++ b/examples/book/builder/basic/main.cc
@@ -12,10 +12,10 @@ void on_button_clicked()
 
 int main (int argc, char **argv)
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   //Load the GtkBuilder file and instantiate its widgets:
-  Glib::RefPtr<Gtk::Builder> refBuilder = Gtk::Builder::create();
+  auto refBuilder = Gtk::Builder::create();
   try
   {
     refBuilder->add_from_file("basic.glade");
diff --git a/examples/book/builder/derived/main.cc b/examples/book/builder/derived/main.cc
index a4b4445..a76ed04 100644
--- a/examples/book/builder/derived/main.cc
+++ b/examples/book/builder/derived/main.cc
@@ -21,10 +21,10 @@
 
 int main (int argc, char **argv)
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   //Load the Glade file and instiate its widgets:
-  Glib::RefPtr<Gtk::Builder> refBuilder = Gtk::Builder::create();
+  auto refBuilder = Gtk::Builder::create();
   try
   {
     refBuilder->add_from_file("derived.glade");
diff --git a/examples/book/buttonbox/main.cc b/examples/book/buttonbox/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/buttonbox/main.cc
+++ b/examples/book/buttonbox/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/buttons/button/main.cc b/examples/book/buttons/button/main.cc
index 7da9c83..76f2a38 100644
--- a/examples/book/buttons/button/main.cc
+++ b/examples/book/buttons/button/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   Buttons buttons;
 
diff --git a/examples/book/buttons/checkbutton/main.cc b/examples/book/buttons/checkbutton/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/buttons/checkbutton/main.cc
+++ b/examples/book/buttons/checkbutton/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/buttons/filechooserbutton/main.cc b/examples/book/buttons/filechooserbutton/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/buttons/filechooserbutton/main.cc
+++ b/examples/book/buttons/filechooserbutton/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/buttons/radiobutton/main.cc b/examples/book/buttons/radiobutton/main.cc
index d1a52d4..90a1c8d 100644
--- a/examples/book/buttons/radiobutton/main.cc
+++ b/examples/book/buttons/radiobutton/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   RadioButtons buttons;
 
diff --git a/examples/book/buttons/scalebutton/main.cc b/examples/book/buttons/scalebutton/main.cc
index 74145c8..baf0f90 100644
--- a/examples/book/buttons/scalebutton/main.cc
+++ b/examples/book/buttons/scalebutton/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow exampleWindow;
 
diff --git a/examples/book/buttons/togglebutton/main.cc b/examples/book/buttons/togglebutton/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/buttons/togglebutton/main.cc
+++ b/examples/book/buttons/togglebutton/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/buttons/volumebutton/main.cc b/examples/book/buttons/volumebutton/main.cc
index 74145c8..baf0f90 100644
--- a/examples/book/buttons/volumebutton/main.cc
+++ b/examples/book/buttons/volumebutton/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow exampleWindow;
 
diff --git a/examples/book/clipboard/ideal/examplewindow.cc b/examples/book/clipboard/ideal/examplewindow.cc
index 90a99d1..769a606 100644
--- a/examples/book/clipboard/ideal/examplewindow.cc
+++ b/examples/book/clipboard/ideal/examplewindow.cc
@@ -90,7 +90,7 @@ void ExampleWindow::on_button_copy()
   strData += m_ButtonB1.get_active() ? "1" : "0";
   strData += m_ButtonB2.get_active() ? "1" : "0";
 
-  Glib::RefPtr<Gtk::Clipboard> refClipboard = Gtk::Clipboard::get();
+  auto refClipboard = Gtk::Clipboard::get();
 
   //Targets:
   std::vector<Gtk::TargetEntry> targets;
@@ -113,7 +113,7 @@ void ExampleWindow::on_button_copy()
 void ExampleWindow::on_button_paste()
 {
   //Tell the clipboard to call our method when it is ready:
-  Glib::RefPtr<Gtk::Clipboard> refClipboard = Gtk::Clipboard::get();
+  auto refClipboard = Gtk::Clipboard::get();
 
   refClipboard->request_contents(example_target_custom, 
     sigc::mem_fun(*this, &ExampleWindow::on_clipboard_received) );
@@ -191,7 +191,7 @@ void ExampleWindow::update_paste_status()
 {
   //Disable the paste button if there is nothing to paste.
 
-  Glib::RefPtr<Gtk::Clipboard> refClipboard = Gtk::Clipboard::get();
+  auto refClipboard = Gtk::Clipboard::get();
 
   //Discover what targets are available:
   refClipboard->request_targets(sigc::mem_fun(*this,
diff --git a/examples/book/clipboard/ideal/main.cc b/examples/book/clipboard/ideal/main.cc
index e3ea615..e38e615 100644
--- a/examples/book/clipboard/ideal/main.cc
+++ b/examples/book/clipboard/ideal/main.cc
@@ -23,7 +23,7 @@ int main(int argc, char *argv[])
 {
   //APPLICATION_NON_UNIQUE because it shall be possible to run several
   //instances of this application simultaneously.
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(
+  auto app = Gtk::Application::create(
     argc, argv, "org.gtkmm.example", Gio::APPLICATION_NON_UNIQUE);
 
   ExampleWindow window;
diff --git a/examples/book/clipboard/simple/examplewindow.cc b/examples/book/clipboard/simple/examplewindow.cc
index aced27f..fdd1399 100644
--- a/examples/book/clipboard/simple/examplewindow.cc
+++ b/examples/book/clipboard/simple/examplewindow.cc
@@ -71,14 +71,14 @@ void ExampleWindow::on_button_copy()
   strData += m_ButtonB1.get_active() ? "1" : "0";
   strData += m_ButtonB2.get_active() ? "1" : "0";
 
-  Glib::RefPtr<Gtk::Clipboard> refClipboard = Gtk::Clipboard::get();
+  auto refClipboard = Gtk::Clipboard::get();
   refClipboard->set_text(strData);
 }
 
 void ExampleWindow::on_button_paste()
 {
   //Tell the clipboard to call our method when it is ready:
-  Glib::RefPtr<Gtk::Clipboard> refClipboard = Gtk::Clipboard::get();
+  auto refClipboard = Gtk::Clipboard::get();
   refClipboard->request_text(sigc::mem_fun(*this,
               &ExampleWindow::on_clipboard_text_received) );
 }
diff --git a/examples/book/clipboard/simple/main.cc b/examples/book/clipboard/simple/main.cc
index e3ea615..e38e615 100644
--- a/examples/book/clipboard/simple/main.cc
+++ b/examples/book/clipboard/simple/main.cc
@@ -23,7 +23,7 @@ int main(int argc, char *argv[])
 {
   //APPLICATION_NON_UNIQUE because it shall be possible to run several
   //instances of this application simultaneously.
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(
+  auto app = Gtk::Application::create(
     argc, argv, "org.gtkmm.example", Gio::APPLICATION_NON_UNIQUE);
 
   ExampleWindow window;
diff --git a/examples/book/combobox/complex/main.cc b/examples/book/combobox/complex/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/combobox/complex/main.cc
+++ b/examples/book/combobox/complex/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/combobox/entry_complex/examplewindow.cc 
b/examples/book/combobox/entry_complex/examplewindow.cc
index 55a7740..a51954f 100644
--- a/examples/book/combobox/entry_complex/examplewindow.cc
+++ b/examples/book/combobox/entry_complex/examplewindow.cc
@@ -70,7 +70,7 @@ ExampleWindow::ExampleWindow()
   add(m_Combo);
 
   //Connect signal handlers:
-  Gtk::Entry* entry = m_Combo.get_entry();
+  auto entry = m_Combo.get_entry();
   if (entry)
   {
     // The Entry shall receive focus-out events.
@@ -99,7 +99,7 @@ ExampleWindow::~ExampleWindow()
 
 void ExampleWindow::on_entry_changed()
 {
-  Gtk::Entry* entry = m_Combo.get_entry();
+  auto entry = m_Combo.get_entry();
   if (entry)
   {
     std::cout << "on_entry_changed(): Row=" << m_Combo.get_active_row_number()
@@ -109,7 +109,7 @@ void ExampleWindow::on_entry_changed()
 
 void ExampleWindow::on_entry_activate()
 {
-  Gtk::Entry* entry = m_Combo.get_entry();
+  auto entry = m_Combo.get_entry();
   if (entry)
   {
     std::cout << "on_entry_activate(): Row=" << m_Combo.get_active_row_number()
@@ -119,7 +119,7 @@ void ExampleWindow::on_entry_activate()
 
 bool ExampleWindow::on_entry_focus_out_event(GdkEventFocus* /* event */)
 {
-  Gtk::Entry* entry = m_Combo.get_entry();
+  auto entry = m_Combo.get_entry();
   if (entry)
   {
     std::cout << "on_entry_focus_out_event(): Row=" << m_Combo.get_active_row_number()
diff --git a/examples/book/combobox/entry_complex/main.cc b/examples/book/combobox/entry_complex/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/combobox/entry_complex/main.cc
+++ b/examples/book/combobox/entry_complex/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/combobox/entry_text/examplewindow.cc 
b/examples/book/combobox/entry_text/examplewindow.cc
index 8076197..a5b36e7 100644
--- a/examples/book/combobox/entry_text/examplewindow.cc
+++ b/examples/book/combobox/entry_text/examplewindow.cc
@@ -33,7 +33,7 @@ ExampleWindow::ExampleWindow()
   add(m_Combo);
 
   //Connect signal handlers:
-  Gtk::Entry* entry = m_Combo.get_entry();
+  auto entry = m_Combo.get_entry();
   // Alternatively you can connect to entry->signal_changed().
   m_Combo.signal_changed().connect(sigc::mem_fun(*this,
     &ExampleWindow::on_combo_changed) );
diff --git a/examples/book/combobox/entry_text/main.cc b/examples/book/combobox/entry_text/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/combobox/entry_text/main.cc
+++ b/examples/book/combobox/entry_text/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/combobox/text/main.cc b/examples/book/combobox/text/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/combobox/text/main.cc
+++ b/examples/book/combobox/text/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/custom/custom_container/main.cc b/examples/book/custom/custom_container/main.cc
index 834048b..27b6cb2 100644
--- a/examples/book/custom/custom_container/main.cc
+++ b/examples/book/custom/custom_container/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/custom/custom_widget/main.cc b/examples/book/custom/custom_widget/main.cc
index 834048b..27b6cb2 100644
--- a/examples/book/custom/custom_widget/main.cc
+++ b/examples/book/custom/custom_widget/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/custom/custom_widget/mywidget.cc b/examples/book/custom/custom_widget/mywidget.cc
index 51b76cd..02f71a1 100644
--- a/examples/book/custom/custom_widget/mywidget.cc
+++ b/examples/book/custom/custom_widget/mywidget.cc
@@ -42,7 +42,7 @@ MyWidget::MyWidget() :
   //std::cout << "Gtype is a GtkWidget?:" << GTK_IS_WIDGET(gobj()) << std::endl;
 
   m_refCssProvider = Gtk::CssProvider::create();
-  Glib::RefPtr<Gtk::StyleContext> refStyleContext = get_style_context();
+  auto refStyleContext = get_style_context();
   refStyleContext->add_provider(m_refCssProvider,
     GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
   m_refCssProvider->signal_parsing_error().connect(
diff --git a/examples/book/dialogs/aboutdialog/main.cc b/examples/book/dialogs/aboutdialog/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/dialogs/aboutdialog/main.cc
+++ b/examples/book/dialogs/aboutdialog/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/dialogs/colorchooserdialog/main.cc 
b/examples/book/dialogs/colorchooserdialog/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/dialogs/colorchooserdialog/main.cc
+++ b/examples/book/dialogs/colorchooserdialog/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/dialogs/filechooserdialog/examplewindow.cc 
b/examples/book/dialogs/filechooserdialog/examplewindow.cc
index 80e8a80..b534563 100644
--- a/examples/book/dialogs/filechooserdialog/examplewindow.cc
+++ b/examples/book/dialogs/filechooserdialog/examplewindow.cc
@@ -91,19 +91,19 @@ void ExampleWindow::on_button_file_clicked()
 
   //Add filters, so that only certain file types can be selected:
 
-  Glib::RefPtr<Gtk::FileFilter> filter_text = Gtk::FileFilter::create();
+  auto filter_text = Gtk::FileFilter::create();
   filter_text->set_name("Text files");
   filter_text->add_mime_type("text/plain");
   dialog.add_filter(filter_text);
 
-  Glib::RefPtr<Gtk::FileFilter> filter_cpp = Gtk::FileFilter::create();
+  auto filter_cpp = Gtk::FileFilter::create();
   filter_cpp->set_name("C/C++ files");
   filter_cpp->add_mime_type("text/x-c");
   filter_cpp->add_mime_type("text/x-c++");
   filter_cpp->add_mime_type("text/x-c-header");
   dialog.add_filter(filter_cpp);
 
-  Glib::RefPtr<Gtk::FileFilter> filter_any = Gtk::FileFilter::create();
+  auto filter_any = Gtk::FileFilter::create();
   filter_any->set_name("Any files");
   filter_any->add_pattern("*");
   dialog.add_filter(filter_any);
diff --git a/examples/book/dialogs/filechooserdialog/main.cc b/examples/book/dialogs/filechooserdialog/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/dialogs/filechooserdialog/main.cc
+++ b/examples/book/dialogs/filechooserdialog/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/dialogs/fontchooserdialog/main.cc b/examples/book/dialogs/fontchooserdialog/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/dialogs/fontchooserdialog/main.cc
+++ b/examples/book/dialogs/fontchooserdialog/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/dialogs/messagedialog/main.cc b/examples/book/dialogs/messagedialog/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/dialogs/messagedialog/main.cc
+++ b/examples/book/dialogs/messagedialog/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/dialogs/simple/main.cc b/examples/book/dialogs/simple/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/dialogs/simple/main.cc
+++ b/examples/book/dialogs/simple/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/drag_and_drop/main.cc b/examples/book/drag_and_drop/main.cc
index 856c051..7735547 100644
--- a/examples/book/drag_and_drop/main.cc
+++ b/examples/book/drag_and_drop/main.cc
@@ -21,7 +21,7 @@
 
 int main (int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   DnDWindow dndWindow;
 
diff --git a/examples/book/drawingarea/arcs/main.cc b/examples/book/drawingarea/arcs/main.cc
index 238a2af..6062183 100644
--- a/examples/book/drawingarea/arcs/main.cc
+++ b/examples/book/drawingarea/arcs/main.cc
@@ -22,7 +22,7 @@
 
 int main(int argc, char** argv)
 {
-   Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+   auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
    Gtk::Window win;
    win.set_title("DrawingArea");
diff --git a/examples/book/drawingarea/clock/clock.cc b/examples/book/drawingarea/clock/clock.cc
index 89c0c3d..3900fbb 100644
--- a/examples/book/drawingarea/clock/clock.cc
+++ b/examples/book/drawingarea/clock/clock.cc
@@ -129,7 +129,7 @@ bool Clock::on_draw(const Cairo::RefPtr<Cairo::Context>& cr)
 bool Clock::on_timeout()
 {
     // force our program to redraw the entire clock.
-    Glib::RefPtr<Gdk::Window> win = get_window();
+    auto win = get_window();
     if (win)
     {
         Gdk::Rectangle r(0, 0, get_allocation().get_width(),
diff --git a/examples/book/drawingarea/clock/main.cc b/examples/book/drawingarea/clock/main.cc
index 944ecab..6d69353 100644
--- a/examples/book/drawingarea/clock/main.cc
+++ b/examples/book/drawingarea/clock/main.cc
@@ -22,7 +22,7 @@
 
 int main(int argc, char** argv)
 {
-   Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+   auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
    Gtk::Window win;
    win.set_title("Cairomm Clock");
diff --git a/examples/book/drawingarea/curve/main.cc b/examples/book/drawingarea/curve/main.cc
index 238a2af..6062183 100644
--- a/examples/book/drawingarea/curve/main.cc
+++ b/examples/book/drawingarea/curve/main.cc
@@ -22,7 +22,7 @@
 
 int main(int argc, char** argv)
 {
-   Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+   auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
    Gtk::Window win;
    win.set_title("DrawingArea");
diff --git a/examples/book/drawingarea/image/main.cc b/examples/book/drawingarea/image/main.cc
index 6f6f351..0e7c5fc 100644
--- a/examples/book/drawingarea/image/main.cc
+++ b/examples/book/drawingarea/image/main.cc
@@ -20,7 +20,7 @@
 
 int main(int argc, char** argv)
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   Gtk::Window win;
   win.set_title("DrawingArea");
diff --git a/examples/book/drawingarea/joins/main.cc b/examples/book/drawingarea/joins/main.cc
index 238a2af..6062183 100644
--- a/examples/book/drawingarea/joins/main.cc
+++ b/examples/book/drawingarea/joins/main.cc
@@ -22,7 +22,7 @@
 
 int main(int argc, char** argv)
 {
-   Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+   auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
    Gtk::Window win;
    win.set_title("DrawingArea");
diff --git a/examples/book/drawingarea/joins/myarea.cc b/examples/book/drawingarea/joins/myarea.cc
index 086cb09..ed49ca9 100644
--- a/examples/book/drawingarea/joins/myarea.cc
+++ b/examples/book/drawingarea/joins/myarea.cc
@@ -30,7 +30,7 @@ MyArea::~MyArea()
 bool MyArea::on_draw(const Cairo::RefPtr<Cairo::Context>& cr)
 {
   // This is where we draw on the window
-  Glib::RefPtr<Gdk::Window> window = get_window();
+  auto window = get_window();
   if(window)
   {
     Gtk::Allocation allocation = get_allocation();
diff --git a/examples/book/drawingarea/pango_text/main.cc b/examples/book/drawingarea/pango_text/main.cc
index bf0fa53..c173649 100644
--- a/examples/book/drawingarea/pango_text/main.cc
+++ b/examples/book/drawingarea/pango_text/main.cc
@@ -20,7 +20,7 @@
 
 int main(int argc, char* argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   Gtk::Window window;
   window.set_title("Drawing text example");
diff --git a/examples/book/drawingarea/pango_text/myarea.cc b/examples/book/drawingarea/pango_text/myarea.cc
index 4685f61..9d4738c 100644
--- a/examples/book/drawingarea/pango_text/myarea.cc
+++ b/examples/book/drawingarea/pango_text/myarea.cc
@@ -80,7 +80,7 @@ void MyArea::draw_text(const Cairo::RefPtr<Cairo::Context>& cr,
   font.set_weight(Pango::WEIGHT_BOLD);
 
   // http://developer.gnome.org/pangomm/unstable/classPango_1_1Layout.html
-  Glib::RefPtr<Pango::Layout> layout = create_pango_layout("Hi there!");
+  auto layout = create_pango_layout("Hi there!");
 
   layout->set_font_description(font);
 
diff --git a/examples/book/drawingarea/simple/main.cc b/examples/book/drawingarea/simple/main.cc
index 238a2af..6062183 100644
--- a/examples/book/drawingarea/simple/main.cc
+++ b/examples/book/drawingarea/simple/main.cc
@@ -22,7 +22,7 @@
 
 int main(int argc, char** argv)
 {
-   Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+   auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
    Gtk::Window win;
    win.set_title("DrawingArea");
diff --git a/examples/book/drawingarea/thin_lines/main.cc b/examples/book/drawingarea/thin_lines/main.cc
index 3852815..14e4c0c 100644
--- a/examples/book/drawingarea/thin_lines/main.cc
+++ b/examples/book/drawingarea/thin_lines/main.cc
@@ -19,7 +19,7 @@
 
 int main(int argc, char* argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/drawingarea/thin_lines/myarea.cc b/examples/book/drawingarea/thin_lines/myarea.cc
index 3a8b475..6d3fd55 100644
--- a/examples/book/drawingarea/thin_lines/myarea.cc
+++ b/examples/book/drawingarea/thin_lines/myarea.cc
@@ -60,7 +60,7 @@ void MyArea::fix_lines(bool fix)
 // force the redraw of the image
 void MyArea::force_redraw()
 {
-  Glib::RefPtr<Gdk::Window> win = get_window();
+  auto win = get_window();
   if (win)
   {
     Gdk::Rectangle r(0, 0, get_allocation().get_width(), get_allocation().get_height());
diff --git a/examples/book/entry/completion/examplewindow.cc b/examples/book/entry/completion/examplewindow.cc
index a0d6b2b..2cacf06 100644
--- a/examples/book/entry/completion/examplewindow.cc
+++ b/examples/book/entry/completion/examplewindow.cc
@@ -39,12 +39,12 @@ ExampleWindow::ExampleWindow()
   m_Button_Close.grab_default();
 
   //Add an EntryCompletion:
-  Glib::RefPtr<Gtk::EntryCompletion> completion =
+  auto completion =
       Gtk::EntryCompletion::create();
   m_Entry.set_completion(completion);
 
   //Create and fill the completion's filter model
-  Glib::RefPtr<Gtk::ListStore> refCompletionModel =
+  auto refCompletionModel =
       Gtk::ListStore::create(m_Columns);
   completion->set_model(refCompletionModel);
 
diff --git a/examples/book/entry/completion/main.cc b/examples/book/entry/completion/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/entry/completion/main.cc
+++ b/examples/book/entry/completion/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/entry/icon/main.cc b/examples/book/entry/icon/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/entry/icon/main.cc
+++ b/examples/book/entry/icon/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/entry/progress/main.cc b/examples/book/entry/progress/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/entry/progress/main.cc
+++ b/examples/book/entry/progress/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/entry/simple/main.cc b/examples/book/entry/simple/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/entry/simple/main.cc
+++ b/examples/book/entry/simple/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/eventbox/main.cc b/examples/book/eventbox/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/eventbox/main.cc
+++ b/examples/book/eventbox/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/expander/main.cc b/examples/book/expander/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/expander/main.cc
+++ b/examples/book/expander/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/flowbox/examplewindow.cc b/examples/book/flowbox/examplewindow.cc
index 7ec0932..3134705 100644
--- a/examples/book/flowbox/examplewindow.cc
+++ b/examples/book/flowbox/examplewindow.cc
@@ -35,7 +35,7 @@ ExampleWindow::ExampleWindow()
   fill_color_names();
   for(std::size_t i = 0; i != m_color_names.size(); ++i)
   {
-    Gtk::Button* color_swatch = create_color_swatch(i);
+    auto color_swatch = create_color_swatch(i);
     m_flow_box.add(*color_swatch);
   }
 
@@ -52,8 +52,8 @@ ExampleWindow::~ExampleWindow()
 
 Gtk::Button* ExampleWindow::create_color_swatch(int swatch_i)
 {
-  Gtk::DrawingArea* drawing_area = Gtk::manage(new Gtk::DrawingArea());
-  Gtk::Button* color_swatch = Gtk::manage(new Gtk::Button());
+  auto drawing_area = Gtk::manage(new Gtk::DrawingArea());
+  auto color_swatch = Gtk::manage(new Gtk::Button());
 
   drawing_area->set_size_request(24, 24);
 
diff --git a/examples/book/flowbox/main.cc b/examples/book/flowbox/main.cc
index 6b643d6..2a44af5 100644
--- a/examples/book/flowbox/main.cc
+++ b/examples/book/flowbox/main.cc
@@ -19,7 +19,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example.flowbox");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example.flowbox");
 
   ExampleWindow window;
 
diff --git a/examples/book/frame/main.cc b/examples/book/frame/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/frame/main.cc
+++ b/examples/book/frame/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/giomm/directory_list/main.cc b/examples/book/giomm/directory_list/main.cc
index 3d777ca..2bb218d 100644
--- a/examples/book/giomm/directory_list/main.cc
+++ b/examples/book/giomm/directory_list/main.cc
@@ -26,15 +26,15 @@ int main(int /* argc */, char** /* argv */)
 
   try
   {
-    Glib::RefPtr<Gio::File> directory = Gio::File::create_for_path("/etc");
+    auto directory = Gio::File::create_for_path("/etc");
     if(!directory)
       std::cerr << "Gio::File::create_for_path() returned an empty RefPtr." << std::endl;
 
-    Glib::RefPtr<Gio::FileEnumerator> enumerator = directory->enumerate_children();
+    auto enumerator = directory->enumerate_children();
     if(!enumerator)
       std::cerr << "Gio::File::enumerate_children() returned an empty RefPtr." << std::endl;
 
-    Glib::RefPtr<Gio::FileInfo> file_info = enumerator->next_file();
+    auto file_info = enumerator->next_file();
     while(file_info)
     {
       std::cout << "file: " << file_info->get_name() << std::endl;
diff --git a/examples/book/giomm/getline/getline.cc b/examples/book/giomm/getline/getline.cc
index 76f36ac..c8d4c8c 100644
--- a/examples/book/giomm/getline/getline.cc
+++ b/examples/book/giomm/getline/getline.cc
@@ -28,9 +28,9 @@
 int main(int /* argc */, char** /* argv */)
 {
   Gio::init();
-  Glib::RefPtr<Gio::File> f = Gio::File::create_for_path("/etc/profile");
-  Glib::RefPtr<Gio::FileInputStream> file_stream = f->read();
-  Glib::RefPtr<Gio::DataInputStream> data_stream = Gio::DataInputStream::create(file_stream);
+  auto f = Gio::File::create_for_path("/etc/profile");
+  auto file_stream = f->read();
+  auto data_stream = Gio::DataInputStream::create(file_stream);
 
   std::string line;
   int line_num = 1;
diff --git a/examples/book/giomm/monitor_directory/monitor_directory.cc 
b/examples/book/giomm/monitor_directory/monitor_directory.cc
index ded10ec..41d75f5 100644
--- a/examples/book/giomm/monitor_directory/monitor_directory.cc
+++ b/examples/book/giomm/monitor_directory/monitor_directory.cc
@@ -71,9 +71,9 @@ bool create_temp_file()
 {
   try
   {
-    Glib::RefPtr<Gio::File> temp_file = Gio::File::create_for_path(FILENAME);
+    auto temp_file = Gio::File::create_for_path(FILENAME);
 
-    Glib::RefPtr<Gio::FileOutputStream> stream = temp_file->create_file ();
+    auto stream = temp_file->create_file ();
     stream->write("This is only a test.");
     stream->close();
   }
@@ -90,7 +90,7 @@ bool quit ()
 {
   try
   {
-    Glib::RefPtr<Gio::File> temp_file = Gio::File::create_for_path(FILENAME);
+    auto temp_file = Gio::File::create_for_path(FILENAME);
     temp_file->trash();
   }
   catch (const Gio::Error& ex)
@@ -110,8 +110,8 @@ int main(int /* argc */, char** /* argv */)
   mainloop = Glib::MainLoop::create();
 
   std::string current_dir = Glib::get_current_dir();
-  Glib::RefPtr<Gio::File> dir = Gio::File::create_for_path(current_dir);
-  Glib::RefPtr<Gio::FileMonitor> monitor = dir->monitor_directory();
+  auto dir = Gio::File::create_for_path(current_dir);
+  auto monitor = dir->monitor_directory();
 
   std::cout << "Monitoring directory '" << current_dir << "'..."
     << std::endl << std::endl;
diff --git a/examples/book/giomm/read_file/main.cc b/examples/book/giomm/read_file/main.cc
index 57eb0db..10fbece 100644
--- a/examples/book/giomm/read_file/main.cc
+++ b/examples/book/giomm/read_file/main.cc
@@ -27,11 +27,11 @@ int main(int /* argc */, char** /* argv */)
 
   try
   {
-    Glib::RefPtr<Gio::File> file = Gio::File::create_for_path("/etc/fstab");
+    auto file = Gio::File::create_for_path("/etc/fstab");
     if(!file)
       std::cerr << "Gio::File::create_for_path() returned an empty RefPtr." << std::endl;
 
-    Glib::RefPtr<Gio::FileInputStream> stream = file->read();
+    auto stream = file->read();
     if(!stream)
       std::cerr << "Gio::File::read() returned an empty RefPtr." << std::endl;
 
diff --git a/examples/book/giomm/usage/usage.cc b/examples/book/giomm/usage/usage.cc
index 67f856a..9539d23 100644
--- a/examples/book/giomm/usage/usage.cc
+++ b/examples/book/giomm/usage/usage.cc
@@ -28,10 +28,10 @@ static goffset get_size_recursively(const Glib::RefPtr<Gio::File>& file)
 
   try
   {
-    Glib::RefPtr<Gio::FileInfo> info = file->query_info();
+    auto info = file->query_info();
     if(info->get_file_type() == Gio::FILE_TYPE_DIRECTORY)
     {
-      Glib::RefPtr<Gio::FileEnumerator> children = file->enumerate_children();
+      auto children = file->enumerate_children();
       Glib::RefPtr<Gio::FileInfo> child_info;
 
       while(child_info = children->next_file())
@@ -63,7 +63,7 @@ int main(int argc, char** argv)
 
   Gio::init();
 
-  Glib::RefPtr<Gio::File> file = Gio::File::create_for_path(root_dir);
+  auto file = Gio::File::create_for_path(root_dir);
   std::cout << "Gathering disk usage information for '" << file->get_path() << "'" << std::endl;
 
   const goffset total = get_size_recursively(file);
diff --git a/examples/book/giomm/volumes/main.cc b/examples/book/giomm/volumes/main.cc
index 99fcab7..4458abc 100644
--- a/examples/book/giomm/volumes/main.cc
+++ b/examples/book/giomm/volumes/main.cc
@@ -7,7 +7,7 @@ int main(int /* argc */, char** /* argv */)
 
   try
   {
-    Glib::RefPtr<Gio::VolumeMonitor> volume_monitor = Gio::VolumeMonitor::get();
+    auto volume_monitor = Gio::VolumeMonitor::get();
     if(!volume_monitor)
       std::cerr << "Gio::VolumeMonitor::get() failed." << std::endl;
 
diff --git a/examples/book/giomm/write_file/main.cc b/examples/book/giomm/write_file/main.cc
index b28504d..c8623ec 100644
--- a/examples/book/giomm/write_file/main.cc
+++ b/examples/book/giomm/write_file/main.cc
@@ -26,7 +26,7 @@ int main(int /* argc */, char** /* argv */)
 
   try
   {
-    Glib::RefPtr<Gio::File> file = Gio::File::create_for_path("test_output.txt");
+    auto file = Gio::File::create_for_path("test_output.txt");
     if(!file)
       std::cerr << "Gio::File::create_for_path() returned an empty RefPtr." << std::endl;
 
diff --git a/examples/book/grid/main.cc b/examples/book/grid/main.cc
index 2822057..40074d4 100644
--- a/examples/book/grid/main.cc
+++ b/examples/book/grid/main.cc
@@ -20,7 +20,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/headerbar/main.cc b/examples/book/headerbar/main.cc
index 3f6a6ab..088f37f 100644
--- a/examples/book/headerbar/main.cc
+++ b/examples/book/headerbar/main.cc
@@ -19,7 +19,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example.headerbar");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example.headerbar");
 
   ExampleWindow window;
 
diff --git a/examples/book/helloworld/main.cc b/examples/book/helloworld/main.cc
index 7dfc6e7..74748bd 100644
--- a/examples/book/helloworld/main.cc
+++ b/examples/book/helloworld/main.cc
@@ -21,7 +21,7 @@
 
 int main (int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   HelloWorld helloworld;
 
diff --git a/examples/book/helloworld2/main.cc b/examples/book/helloworld2/main.cc
index 7dfc6e7..74748bd 100644
--- a/examples/book/helloworld2/main.cc
+++ b/examples/book/helloworld2/main.cc
@@ -21,7 +21,7 @@
 
 int main (int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   HelloWorld helloworld;
 
diff --git a/examples/book/iconview/main.cc b/examples/book/iconview/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/iconview/main.cc
+++ b/examples/book/iconview/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/idle/idleexample.cc b/examples/book/idle/idleexample.cc
index bf81882..b7c7fbf 100644
--- a/examples/book/idle/idleexample.cc
+++ b/examples/book/idle/idleexample.cc
@@ -38,7 +38,7 @@ IdleExample::IdleExample() :
   m_Box.pack_start( *Gtk::manage(new Gtk::Label("5000 MB")) );
   m_Box.pack_start(m_ProgressBar_d);
 
-  Gtk::Box* hbox = Gtk::manage( new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL,10));
+  auto hbox = Gtk::manage( new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL,10));
   m_Box.pack_start(*hbox);
   hbox->pack_start(m_ButtonQuit, Gtk::PACK_EXPAND_PADDING);
 
diff --git a/examples/book/idle/main.cc b/examples/book/idle/main.cc
index 6f60ec5..4202659 100644
--- a/examples/book/idle/main.cc
+++ b/examples/book/idle/main.cc
@@ -21,7 +21,7 @@
 
 int main (int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   IdleExample example;
   return app->run(example);
diff --git a/examples/book/infobar/examplewindow.cc b/examples/book/infobar/examplewindow.cc
index 15863f9..1a29933 100644
--- a/examples/book/infobar/examplewindow.cc
+++ b/examples/book/infobar/examplewindow.cc
@@ -28,7 +28,7 @@ ExampleWindow::ExampleWindow()
   add(m_VBox);
 
   // Add the message label to the InfoBar:
-  Gtk::Container* infoBarContainer =
+  auto infoBarContainer =
     dynamic_cast<Gtk::Container*>(m_InfoBar.get_content_area());
   if (infoBarContainer)
     infoBarContainer->add(m_Message_Label);
diff --git a/examples/book/infobar/main.cc b/examples/book/infobar/main.cc
index 6d68ea5..66399c9 100644
--- a/examples/book/infobar/main.cc
+++ b/examples/book/infobar/main.cc
@@ -19,7 +19,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
   //Shows the window and returns when it is closed.
diff --git a/examples/book/keyboard_events/propagation/main.cc 
b/examples/book/keyboard_events/propagation/main.cc
index 08ec0bb..d9f56dc 100644
--- a/examples/book/keyboard_events/propagation/main.cc
+++ b/examples/book/keyboard_events/propagation/main.cc
@@ -19,7 +19,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/keyboard_events/simple/main.cc b/examples/book/keyboard_events/simple/main.cc
index 08ec0bb..d9f56dc 100644
--- a/examples/book/keyboard_events/simple/main.cc
+++ b/examples/book/keyboard_events/simple/main.cc
@@ -19,7 +19,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/label/main.cc b/examples/book/label/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/label/main.cc
+++ b/examples/book/label/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/listbox/examplewindow.cc b/examples/book/listbox/examplewindow.cc
index 7302418..f4fb992 100644
--- a/examples/book/listbox/examplewindow.cc
+++ b/examples/book/listbox/examplewindow.cc
@@ -131,7 +131,7 @@ ExampleWindow::ExampleWindow() :
   m_ListBox.signal_row_activated().connect(sigc::mem_fun(*this, &ExampleWindow::on_row_activated));
 
   // Add some rows to the ListBox.
-  ExampleRow* row = Gtk::manage(new ExampleRow("blah4", 4));
+  auto row = Gtk::manage(new ExampleRow("blah4", 4));
   m_ListBox.append(*row);
   m_ListBox.append(m_Row3); // blah3
   row = Gtk::manage(new ExampleRow("blah1", 1));
@@ -259,7 +259,7 @@ void ExampleWindow::on_add_clicked()
 {
   static int new_button_nr = 1;
   const Glib::ustring text = "blah2 new " + Glib::ustring::format(new_button_nr);
-  ExampleRow* new_row = Gtk::manage(new ExampleRow(text, new_button_nr));
+  auto new_row = Gtk::manage(new ExampleRow(text, new_button_nr));
   new_row->show_all();
   m_ListBox.append(*new_row);
   ++new_button_nr;
@@ -277,27 +277,28 @@ void ExampleWindow::on_unseparate_clicked()
 
 void ExampleWindow::update_header_func(Gtk::ListBoxRow* row, Gtk::ListBoxRow* before)
 {
-  ExampleRow* xrow = dynamic_cast<ExampleRow*>(row);
+  auto xrow = dynamic_cast<ExampleRow*>(row);
   if (!before || (xrow && xrow->get_text() == "blah3"))
   {
     // Create header if needed.
     if (!row->get_header())
     {
-      Gtk::Box* hbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL));
-      Gtk::Label* label = Gtk::manage(new Gtk::Label("Header"));
+      auto hbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL));
+      auto label = Gtk::manage(new Gtk::Label("Header"));
       hbox->pack_start(*label, Gtk::PACK_SHRINK);
-      Gtk::Button* button = Gtk::manage(new Gtk::Button("button"));
+      auto button = Gtk::manage(new Gtk::Button("button"));
       hbox->pack_start(*button, Gtk::PACK_SHRINK);
       hbox->show_all();
       row->set_header(*hbox);
     }
-    Gtk::Container* header = dynamic_cast<Gtk::Container*>(row->get_header());
+
+    auto header = dynamic_cast<Gtk::Container*>(row->get_header());
     if (header)
     {
       std::vector<Gtk::Widget*> children = header->get_children();
       if (children.size() > 0)
       {
-        Gtk::Label* label = dynamic_cast<Gtk::Label*>(children[0]);
+        auto label = dynamic_cast<Gtk::Label*>(children[0]);
         if (label && xrow)
           label->set_text("Header " + Glib::ustring::format(xrow->get_sort_id()));
       }
diff --git a/examples/book/listbox/main.cc b/examples/book/listbox/main.cc
index 3d7a9e6..2716e91 100644
--- a/examples/book/listbox/main.cc
+++ b/examples/book/listbox/main.cc
@@ -18,7 +18,7 @@
 
 int main (int argc, char* argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/menus/main_menu/exampleapplication.cc 
b/examples/book/menus/main_menu/exampleapplication.cc
index bfcaf0b..3aaef6b 100644
--- a/examples/book/menus/main_menu/exampleapplication.cc
+++ b/examples/book/menus/main_menu/exampleapplication.cc
@@ -199,10 +199,10 @@ void ExampleApplication::on_startup()
   }
 
   //Get the menubar and the app menu, and add them to the application:
-  Glib::RefPtr<Glib::Object> object = m_refBuilder->get_object("menu-example");
-  Glib::RefPtr<Gio::Menu> gmenu = Glib::RefPtr<Gio::Menu>::cast_dynamic(object);
+  auto object = m_refBuilder->get_object("menu-example");
+  auto gmenu = Glib::RefPtr<Gio::Menu>::cast_dynamic(object);
   object = m_refBuilder->get_object("appmenu");
-  Glib::RefPtr<Gio::Menu> appMenu = Glib::RefPtr<Gio::Menu>::cast_dynamic(object);
+  auto appMenu = Glib::RefPtr<Gio::Menu>::cast_dynamic(object);
   if (!(gmenu && appMenu)) {
     g_warning("GMenu or AppMenu not found");
   }
@@ -224,7 +224,7 @@ void ExampleApplication::on_activate()
 
 void ExampleApplication::create_window()
 {
-  ExampleWindow* win = new ExampleWindow();
+  auto win = new ExampleWindow();
 
   //Make sure that the application runs for as long this window is still open:
   add_window(*win);
diff --git a/examples/book/menus/main_menu/main.cc b/examples/book/menus/main_menu/main.cc
index 67c9d27..708fbc1 100644
--- a/examples/book/menus/main_menu/main.cc
+++ b/examples/book/menus/main_menu/main.cc
@@ -18,7 +18,7 @@
 
 int main(int argc, char* argv[])
 {
-  Glib::RefPtr<ExampleApplication> application = ExampleApplication::create();
+  auto application = ExampleApplication::create();
 
   // Start the application, showing the initial window,
   // and opening extra windows for any files that it is asked to open,
diff --git a/examples/book/menus/popup/examplewindow.cc b/examples/book/menus/popup/examplewindow.cc
index b853ed3..cbf0ee1 100644
--- a/examples/book/menus/popup/examplewindow.cc
+++ b/examples/book/menus/popup/examplewindow.cc
@@ -38,7 +38,7 @@ ExampleWindow::ExampleWindow()
 
   //Fill menu:
 
-  Glib::RefPtr<Gio::SimpleActionGroup> refActionGroup =
+  auto refActionGroup =
     Gio::SimpleActionGroup::create();
 
   //File|New sub menu:
@@ -91,9 +91,9 @@ ExampleWindow::ExampleWindow()
   }
 
   //Get the menu:
-  Glib::RefPtr<Glib::Object> object =
+  auto object =
     m_refBuilder->get_object("menu-examplepopup");
-  Glib::RefPtr<Gio::Menu> gmenu =
+  auto gmenu =
     Glib::RefPtr<Gio::Menu>::cast_dynamic(object);
   if(!gmenu)
     g_warning("GMenu not found");
diff --git a/examples/book/menus/popup/main.cc b/examples/book/menus/popup/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/menus/popup/main.cc
+++ b/examples/book/menus/popup/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/menus_and_toolbars/examplewindow.cc 
b/examples/book/menus_and_toolbars/examplewindow.cc
index 85331b7..57ebaa5 100644
--- a/examples/book/menus_and_toolbars/examplewindow.cc
+++ b/examples/book/menus_and_toolbars/examplewindow.cc
@@ -130,13 +130,13 @@ ExampleWindow::ExampleWindow(const Glib::RefPtr<Gtk::Application>& app)
   }
 
   //Get the menubar:
-  Glib::RefPtr<Glib::Object> object = m_refBuilder->get_object("menubar");
-  Glib::RefPtr<Gio::Menu> gmenu = Glib::RefPtr<Gio::Menu>::cast_dynamic(object);
+  auto object = m_refBuilder->get_object("menubar");
+  auto gmenu = Glib::RefPtr<Gio::Menu>::cast_dynamic(object);
   if (!gmenu)
     g_warning("GMenu not found");
   else
   {
-    Gtk::MenuBar* pMenuBar = Gtk::manage(new Gtk::MenuBar(gmenu));
+    auto pMenuBar = Gtk::manage(new Gtk::MenuBar(gmenu));
 
     //Add the MenuBar to the window:
     m_Box.pack_start(*pMenuBar, Gtk::PACK_SHRINK);
diff --git a/examples/book/menus_and_toolbars/main.cc b/examples/book/menus_and_toolbars/main.cc
index c35ad14..a77f90f 100644
--- a/examples/book/menus_and_toolbars/main.cc
+++ b/examples/book/menus_and_toolbars/main.cc
@@ -19,7 +19,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window(app);
 
diff --git a/examples/book/multithread/examplewindow.cc b/examples/book/multithread/examplewindow.cc
index a1405c8..7a68803 100644
--- a/examples/book/multithread/examplewindow.cc
+++ b/examples/book/multithread/examplewindow.cc
@@ -70,7 +70,7 @@ ExampleWindow::ExampleWindow() :
   m_Dispatcher.connect(sigc::mem_fun(*this, &ExampleWindow::on_notification_from_worker_thread));
 
   // Create a text buffer mark for use in update_widgets().
-  Glib::RefPtr<Gtk::TextBuffer> buffer = m_TextView.get_buffer();
+  auto buffer = m_TextView.get_buffer();
   buffer->create_mark("last_line", buffer->end(), /* left_gravity= */ true);
 
   update_start_stop_buttons();
@@ -125,13 +125,13 @@ void ExampleWindow::update_widgets()
 
   if (message_from_worker_thread != m_TextView.get_buffer()->get_text())
   {
-    Glib::RefPtr<Gtk::TextBuffer> buffer = m_TextView.get_buffer();
+    auto buffer = m_TextView.get_buffer();
     buffer->set_text(message_from_worker_thread);
 
     // Scroll the last inserted line into view. That's somewhat complicated.
     Gtk::TextIter iter = buffer->end();
     iter.set_line_offset(0); // Beginning of last line
-    Glib::RefPtr<Gtk::TextMark> mark = buffer->get_mark("last_line");
+    auto mark = buffer->get_mark("last_line");
     buffer->move_mark(mark, iter);
     m_TextView.scroll_to(mark);
     // TextView::scroll_to(iter) is not perfect.
diff --git a/examples/book/multithread/main.cc b/examples/book/multithread/main.cc
index 3d7a9e6..2716e91 100644
--- a/examples/book/multithread/main.cc
+++ b/examples/book/multithread/main.cc
@@ -18,7 +18,7 @@
 
 int main (int argc, char* argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/notebook/main.cc b/examples/book/notebook/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/notebook/main.cc
+++ b/examples/book/notebook/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/paned/main.cc b/examples/book/paned/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/paned/main.cc
+++ b/examples/book/paned/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/paned/messagetext.cc b/examples/book/paned/messagetext.cc
index 94918b2..8ce087a 100644
--- a/examples/book/paned/messagetext.cc
+++ b/examples/book/paned/messagetext.cc
@@ -34,7 +34,7 @@ MessageText::~MessageText()
 
 void MessageText::insert_text()
 {
-  Glib::RefPtr<Gtk::TextBuffer> refTextBuffer = m_TextView.get_buffer();
+  auto refTextBuffer = m_TextView.get_buffer();
 
   Gtk::TextBuffer::iterator iter = refTextBuffer->get_iter_at_offset(0);
   refTextBuffer->insert(iter,
diff --git a/examples/book/placessidebar/examplewindow.cc b/examples/book/placessidebar/examplewindow.cc
index ead69b6..a697f42 100644
--- a/examples/book/placessidebar/examplewindow.cc
+++ b/examples/book/placessidebar/examplewindow.cc
@@ -116,7 +116,7 @@ void ExampleWindow::on_placessidebar_open_location(const Glib::RefPtr<Gio::File>
 
 void ExampleWindow::on_placessidebar_populate_popup(Gtk::Menu* menu, const Glib::RefPtr<Gio::File>& /* 
selected_item */, const Glib::RefPtr<Gio::Volume>& /* selected_volume */)
 {
-  Gtk::MenuItem* properties_menu_item = new Gtk::MenuItem("Properties...");
+  auto properties_menu_item = new Gtk::MenuItem("Properties...");
 
   properties_menu_item->signal_activate().connect(sigc::mem_fun(*this, 
&ExampleWindow::on_menu_properties_activate));
   properties_menu_item->show();
@@ -126,7 +126,7 @@ void ExampleWindow::on_placessidebar_populate_popup(Gtk::Menu* menu, const Glib:
 
 void ExampleWindow::on_menu_properties_activate()
 {
-  Glib::RefPtr<Gio::File> selected_item = m_places_sidebar.get_location();
+  auto selected_item = m_places_sidebar.get_location();
 
   on_placessidebar_open_location(selected_item, Gtk::PLACES_OPEN_NORMAL);
 }
diff --git a/examples/book/placessidebar/main.cc b/examples/book/placessidebar/main.cc
index 508fc5b..50b2078 100644
--- a/examples/book/placessidebar/main.cc
+++ b/examples/book/placessidebar/main.cc
@@ -19,7 +19,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, 
"org.gtkmm.example.placessidebar");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example.placessidebar");
 
   ExampleWindow window;
 
diff --git a/examples/book/popover/examplewindow.cc b/examples/book/popover/examplewindow.cc
index 00e3575..9cb0591 100644
--- a/examples/book/popover/examplewindow.cc
+++ b/examples/book/popover/examplewindow.cc
@@ -101,7 +101,7 @@ void ExampleWindow::configure_form_buttons()
   m_format_buttons_box.set_hexpand();
 
   // Group format buttons so that they appear that they belong together
-  Glib::RefPtr<Gtk::StyleContext> style_context = m_format_buttons_box.get_style_context();
+  auto style_context = m_format_buttons_box.get_style_context();
   style_context->add_class("raised");
   style_context->add_class("linked");
 }
@@ -147,7 +147,7 @@ void ExampleWindow::on_day_selected()
 {
   Gdk::Rectangle rect;
 
-  GdkEvent* current_event = gtk_get_current_event();
+  auto current_event = gtk_get_current_event();
 
   if (current_event->type != GDK_BUTTON_PRESS)
   {
diff --git a/examples/book/popover/main.cc b/examples/book/popover/main.cc
index 41389fe..ed4aaea 100644
--- a/examples/book/popover/main.cc
+++ b/examples/book/popover/main.cc
@@ -19,7 +19,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example.popovers");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example.popovers");
 
   ExampleWindow window;
 
diff --git a/examples/book/printing/advanced/examplewindow.cc 
b/examples/book/printing/advanced/examplewindow.cc
index ee6be50..7be0dac 100644
--- a/examples/book/printing/advanced/examplewindow.cc
+++ b/examples/book/printing/advanced/examplewindow.cc
@@ -77,7 +77,7 @@ ExampleWindow::~ExampleWindow()
 void ExampleWindow::build_main_menu()
 {
   //Create actions for menus and toolbars:
-  Glib::RefPtr<Gio::SimpleActionGroup> refActionGroup =
+  auto refActionGroup =
    Gio::SimpleActionGroup::create();
 
   //File menu:
@@ -146,18 +146,18 @@ void ExampleWindow::build_main_menu()
 
 
   //Get the menubar and toolbar widgets, and add them to a container widget:
-  Glib::RefPtr<Glib::Object> object =
+  auto object =
     m_refBuilder->get_object("menu-example");
-  Glib::RefPtr<Gio::Menu> gmenu =
+  auto gmenu =
     Glib::RefPtr<Gio::Menu>::cast_dynamic(object);
   if(!gmenu)
     g_warning("GMenu not found");
 
-  Gtk::MenuBar* pMenubar = new Gtk::MenuBar(gmenu);
+  auto pMenubar = new Gtk::MenuBar(gmenu);
   m_VBox.pack_start(*pMenubar, Gtk::PACK_SHRINK);
 
 /* TODO:
-  Gtk::Widget* pToolbar = m_refBuilder->get_widget("/ToolBar") ;
+  auto pToolbar = m_refBuilder->get_widget("/ToolBar") ;
   if(pToolbar)
     m_VBox.pack_start(*pToolbar, Gtk::PACK_SHRINK);
 */
@@ -211,7 +211,7 @@ void ExampleWindow::print_or_preview(Gtk::PrintOperationAction print_action)
 {
   //Create a new PrintOperation with our PageSetup and PrintSettings:
   //(We use our derived PrintOperation class)
-  Glib::RefPtr<PrintFormOperation> print = PrintFormOperation::create();
+  auto print = PrintFormOperation::create();
 
   print->set_name(m_NameEntry.get_text() + " " + m_SurnameEntry.get_text());
   print->set_comments(m_refTextBuffer->get_text(false /*Don't include hidden*/));
@@ -252,7 +252,7 @@ void ExampleWindow::on_menu_file_new()
 void ExampleWindow::on_menu_file_page_setup()
 {
   //Show the page setup dialog, asking it to start with the existing settings:
-  Glib::RefPtr<Gtk::PageSetup> new_page_setup =
+  auto new_page_setup =
       Gtk::run_page_setup_dialog(*this, m_refPageSetup, m_refSettings);
 
   //Save the chosen page setup dialog for use when printing, previewing, or
diff --git a/examples/book/printing/advanced/main.cc b/examples/book/printing/advanced/main.cc
index f6a7ced..dcf25e5 100644
--- a/examples/book/printing/advanced/main.cc
+++ b/examples/book/printing/advanced/main.cc
@@ -19,7 +19,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/printing/advanced/previewdialog.cc 
b/examples/book/printing/advanced/previewdialog.cc
index 340980a..08077bf 100644
--- a/examples/book/printing/advanced/previewdialog.cc
+++ b/examples/book/printing/advanced/previewdialog.cc
@@ -75,7 +75,7 @@ PreviewDialog::~PreviewDialog()
 
 void PreviewDialog::on_drawing_area_realized()
 {
-  Glib::RefPtr<Gdk::Window> gdk_window = m_DrawingArea.get_window();
+  auto gdk_window = m_DrawingArea.get_window();
   if(gdk_window)
   {
     Cairo::RefPtr<Cairo::Context> cairo_ctx =
@@ -150,7 +150,7 @@ void PreviewDialog::on_popreview_got_page_size(
 
     if(m_pOperation)
     {
-      Glib::RefPtr<Pango::Layout> layout = m_pOperation->get_pango_layout();
+      auto layout = m_pOperation->get_pango_layout();
       if(layout)
         layout->update_from_cairo_context(cairo_ctx);
     }
diff --git a/examples/book/printing/advanced/printformoperation.cc 
b/examples/book/printing/advanced/printformoperation.cc
index 2be775e..42096f1 100644
--- a/examples/book/printing/advanced/printformoperation.cc
+++ b/examples/book/printing/advanced/printformoperation.cc
@@ -129,7 +129,7 @@ void PrintFormOperation::on_draw_page(
   {
     if(line_index >= start_page_line)
     {
-      Glib::RefPtr<Pango::LayoutLine> layout_line = iter.get_line();
+      auto layout_line = iter.get_line();
       Pango::Rectangle logical_rect = iter.get_line_logical_extents();
       int baseline = iter.get_baseline();
 
@@ -154,15 +154,15 @@ Gtk::Widget* PrintFormOperation::on_create_custom_widget()
   //Create a custom tab in the print dialog titled "Other"
   set_custom_tab_label("Other");
 
-  Gtk::Box* vbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL));
+  auto vbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL));
   vbox->set_border_width(12);
 
-  Gtk::Box* hbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL, 8));
+  auto hbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL, 8));
   vbox->pack_start(*hbox, false, false);
   hbox->set_border_width(6);
   hbox->show();
 
-  Gtk::Label* label = Gtk::manage(new Gtk::Label("Choose a font: "));
+  auto label = Gtk::manage(new Gtk::Label("Choose a font: "));
   hbox->pack_start(*label, false, false);
   label->show();
 
diff --git a/examples/book/printing/simple/examplewindow.cc b/examples/book/printing/simple/examplewindow.cc
index 5504b8b..42496da 100644
--- a/examples/book/printing/simple/examplewindow.cc
+++ b/examples/book/printing/simple/examplewindow.cc
@@ -78,7 +78,7 @@ ExampleWindow::~ExampleWindow()
 void ExampleWindow::build_main_menu()
 {
   //Create actions for menus and toolbars:
-  Glib::RefPtr<Gio::SimpleActionGroup> refActionGroup =
+  auto refActionGroup =
    Gio::SimpleActionGroup::create();
 
   //File menu:
@@ -147,18 +147,18 @@ void ExampleWindow::build_main_menu()
 
 
   //Get the menubar and toolbar widgets, and add them to a container widget:
-  Glib::RefPtr<Glib::Object> object =
+  auto object =
     m_refBuilder->get_object("menu-example");
-  Glib::RefPtr<Gio::Menu> gmenu =
+  auto gmenu =
     Glib::RefPtr<Gio::Menu>::cast_dynamic(object);
   if(!gmenu)
     g_warning("GMenu not found");
 
-  Gtk::MenuBar* pMenubar = new Gtk::MenuBar(gmenu);
+  auto pMenubar = new Gtk::MenuBar(gmenu);
   m_VBox.pack_start(*pMenubar, Gtk::PACK_SHRINK);
 
 /* TODO:
-  Gtk::Widget* pToolbar = m_refBuilder->get_widget("/ToolBar") ;
+  auto pToolbar = m_refBuilder->get_widget("/ToolBar") ;
   if(pToolbar)
     m_VBox.pack_start(*pToolbar, Gtk::PACK_SHRINK);
 */
@@ -214,7 +214,7 @@ void ExampleWindow::print_or_preview(Gtk::PrintOperationAction print_action)
 {
   //Create a new PrintOperation with our PageSetup and PrintSettings:
   //(We use our derived PrintOperation class)
-  Glib::RefPtr<PrintFormOperation> print = PrintFormOperation::create();
+  auto print = PrintFormOperation::create();
 
   print->set_name(m_NameEntry.get_text() + " " + m_SurnameEntry.get_text());
   print->set_comments(m_refTextBuffer->get_text(false /*Don't include hidden*/));
@@ -249,7 +249,7 @@ void ExampleWindow::on_menu_file_new()
 void ExampleWindow::on_menu_file_page_setup()
 {
   //Show the page setup dialog, asking it to start with the existing settings:
-  Glib::RefPtr<Gtk::PageSetup> new_page_setup =
+  auto new_page_setup =
       Gtk::run_page_setup_dialog(*this, m_refPageSetup, m_refSettings);
 
   //Save the chosen page setup dialog for use when printing, previewing, or
diff --git a/examples/book/printing/simple/main.cc b/examples/book/printing/simple/main.cc
index f6a7ced..dcf25e5 100644
--- a/examples/book/printing/simple/main.cc
+++ b/examples/book/printing/simple/main.cc
@@ -19,7 +19,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/printing/simple/printformoperation.cc 
b/examples/book/printing/simple/printformoperation.cc
index eed6eac..c6ee4f3 100644
--- a/examples/book/printing/simple/printformoperation.cc
+++ b/examples/book/printing/simple/printformoperation.cc
@@ -121,7 +121,7 @@ void PrintFormOperation::on_draw_page(
   {
     if(line_index >= start_page_line)
     {
-      Glib::RefPtr<Pango::LayoutLine> layout_line = iter.get_line();
+      auto layout_line = iter.get_line();
       Pango::Rectangle logical_rect = iter.get_line_logical_extents();
       int baseline = iter.get_baseline();
 
diff --git a/examples/book/progressbar/main.cc b/examples/book/progressbar/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/progressbar/main.cc
+++ b/examples/book/progressbar/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/range_widgets/main.cc b/examples/book/range_widgets/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/range_widgets/main.cc
+++ b/examples/book/range_widgets/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/recent_files/examplewindow.cc b/examples/book/recent_files/examplewindow.cc
index 0d67a6f..4feeb1f 100644
--- a/examples/book/recent_files/examplewindow.cc
+++ b/examples/book/recent_files/examplewindow.cc
@@ -119,12 +119,12 @@ ExampleWindow::ExampleWindow(const Glib::RefPtr<Gtk::Application>& app)
   }
 
   //Get the menubar and toolbar widgets, and add them to a container widget:
-  Glib::RefPtr<Glib::Object> object = m_refBuilder->get_object("menubar");
-  Glib::RefPtr<Gio::Menu> gmenu = Glib::RefPtr<Gio::Menu>::cast_dynamic(object);
+  auto object = m_refBuilder->get_object("menubar");
+  auto gmenu = Glib::RefPtr<Gio::Menu>::cast_dynamic(object);
   if (gmenu)
   {
     //Menubar:
-    Gtk::MenuBar* pMenubar = Gtk::manage(new Gtk::MenuBar(gmenu));
+    auto pMenubar = Gtk::manage(new Gtk::MenuBar(gmenu));
     m_Box.pack_start(*pMenubar, Gtk::PACK_SHRINK);
   }
   else
diff --git a/examples/book/recent_files/main.cc b/examples/book/recent_files/main.cc
index 5c0ce57..442afad 100644
--- a/examples/book/recent_files/main.cc
+++ b/examples/book/recent_files/main.cc
@@ -19,7 +19,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window(app);
 
diff --git a/examples/book/revealer/main.cc b/examples/book/revealer/main.cc
index cdc2b67..5e130c9 100644
--- a/examples/book/revealer/main.cc
+++ b/examples/book/revealer/main.cc
@@ -19,7 +19,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example.revealer");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example.revealer");
 
   ExampleWindow window;
 
diff --git a/examples/book/scrolledwindow/examplewindow.cc b/examples/book/scrolledwindow/examplewindow.cc
index 3f68fe3..546f757 100644
--- a/examples/book/scrolledwindow/examplewindow.cc
+++ b/examples/book/scrolledwindow/examplewindow.cc
@@ -51,7 +51,7 @@ ExampleWindow::ExampleWindow()
      {
         char buffer[32];
         sprintf(buffer, "button (%d,%d)\n", i, j);
-        Gtk::Button* pButton = Gtk::manage(new Gtk::ToggleButton(buffer));
+        auto pButton = Gtk::manage(new Gtk::ToggleButton(buffer));
         m_Grid.attach(*pButton, i, j, 1, 1);
      }
   }
diff --git a/examples/book/scrolledwindow/main.cc b/examples/book/scrolledwindow/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/scrolledwindow/main.cc
+++ b/examples/book/scrolledwindow/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/searchbar/main.cc b/examples/book/searchbar/main.cc
index a5e307a..edd65c5 100644
--- a/examples/book/searchbar/main.cc
+++ b/examples/book/searchbar/main.cc
@@ -19,7 +19,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example.searchbar");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example.searchbar");
 
   ExampleWindow window;
 
diff --git a/examples/book/socket/plug.cc b/examples/book/socket/plug.cc
index fd8727a..8f13761 100644
--- a/examples/book/socket/plug.cc
+++ b/examples/book/socket/plug.cc
@@ -35,7 +35,7 @@ int main(int argc, char** argv)
 {
   // The plug and the socket have different application ids, so they can run
   // simultaneously.
-  Glib::RefPtr<Gtk::Application> app =
+  auto app =
     Gtk::Application::create(argc, argv, "org.gtkmm.example.plug");
   MyPlug plug;
   plug.show();
diff --git a/examples/book/socket/socket.cc b/examples/book/socket/socket.cc
index e6996c5..2a431fa 100644
--- a/examples/book/socket/socket.cc
+++ b/examples/book/socket/socket.cc
@@ -27,7 +27,7 @@ class MySocketWindow : public Gtk::Window
       ifstream infile(id_filename);
       if (infile)
       {
-        Gtk::Socket* socket = Gtk::manage(new Gtk::Socket());
+        auto socket = Gtk::manage(new Gtk::Socket());
         add(*socket);
         socket->signal_plug_added().connect(sigc::ptr_fun(plug_added));
         socket->signal_plug_removed().connect(sigc::ptr_fun(plug_removed));
@@ -38,7 +38,7 @@ class MySocketWindow : public Gtk::Window
       }
       else
       {
-        Gtk::Label* label = Gtk::manage(
+        auto label = Gtk::manage(
             new Gtk::Label(
               "Plug id file not found.\n Make sure plug is running."));
         add(*label);
@@ -52,7 +52,7 @@ int main(int argc, char** argv)
 {
   // The plug and the socket have different application ids, so they can run
   // simultaneously.
-  Glib::RefPtr<Gtk::Application> app =
+  auto app =
     Gtk::Application::create(argc, argv, "org.gtkmm.example.socket");
   MySocketWindow win;
   app->run(win);
diff --git a/examples/book/spinbutton/main.cc b/examples/book/spinbutton/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/spinbutton/main.cc
+++ b/examples/book/spinbutton/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/textview/main.cc b/examples/book/textview/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/textview/main.cc
+++ b/examples/book/textview/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/timeout/main.cc b/examples/book/timeout/main.cc
index be36913..a4cd56b 100644
--- a/examples/book/timeout/main.cc
+++ b/examples/book/timeout/main.cc
@@ -21,7 +21,7 @@
 
 int main (int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   TimerExample example;
   return app->run(example);
diff --git a/examples/book/toolbar/examplewindow.cc b/examples/book/toolbar/examplewindow.cc
index 0a482e8..454d911 100644
--- a/examples/book/toolbar/examplewindow.cc
+++ b/examples/book/toolbar/examplewindow.cc
@@ -48,7 +48,7 @@ ExampleWindow::ExampleWindow()
 
     m_Toolbar.set_toolbar_style(Gtk::TOOLBAR_BOTH);
 
-    Gtk::ToolButton* item = Gtk::manage(new Gtk::ToolButton("Click me"));
+    auto item = Gtk::manage(new Gtk::ToolButton("Click me"));
     //item.set_tooltips(*tooltips, "Toolbar item");
     m_Toolbar.append(*item);
     item->signal_clicked().connect( sigc::mem_fun(*this,
diff --git a/examples/book/toolbar/main.cc b/examples/book/toolbar/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/toolbar/main.cc
+++ b/examples/book/toolbar/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/toolpalette/canvas.cc b/examples/book/toolpalette/canvas.cc
index ee8de84..543482b 100644
--- a/examples/book/toolpalette/canvas.cc
+++ b/examples/book/toolpalette/canvas.cc
@@ -30,8 +30,8 @@ Canvas::~Canvas()
 {
   while(!m_canvas_items.empty())
   {
-    type_vec_items::iterator iter = m_canvas_items.begin();
-    CanvasItem* item = *iter;
+    auto iter = m_canvas_items.begin();
+    auto item = *iter;
     delete item;
     m_canvas_items.erase(iter);
   }
@@ -115,9 +115,9 @@ void Canvas::on_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& context
   int x, int y, const Gtk::SelectionData& selection_data, guint info, guint time)
 {
   // Find the tool button which is the source of this DnD operation.
-  Gtk::Widget* widget = drag_get_source_widget(context);
+  auto widget = drag_get_source_widget(context);
 
-  Gtk::ToolPalette* drag_palette = dynamic_cast<Gtk::ToolPalette*>(widget);
+  auto drag_palette = dynamic_cast<Gtk::ToolPalette*>(widget);
   while(widget && !drag_palette)
   {
     widget = widget->get_parent();
@@ -129,7 +129,7 @@ void Canvas::on_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& context
     drag_item = drag_palette->get_drag_item(selection_data);
 
   // Create a drop indicator when a tool button was found:
-  Gtk::ToolButton* button = dynamic_cast<Gtk::ToolButton*>(drag_item);
+  auto button = dynamic_cast<Gtk::ToolButton*>(drag_item);
   if(!button)
     return;
 
@@ -138,7 +138,7 @@ void Canvas::on_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& context
 
   try
   {
-    CanvasItem* item = new CanvasItem(this, button, x, y);
+    auto item = new CanvasItem(this, button, x, y);
 
     if(m_drag_data_requested_for_drop)
     {
diff --git a/examples/book/toolpalette/canvas.h b/examples/book/toolpalette/canvas.h
index a25e8cb..29068ca 100644
--- a/examples/book/toolpalette/canvas.h
+++ b/examples/book/toolpalette/canvas.h
@@ -41,7 +41,7 @@ private:
       if (icon_name.empty())
         icon_name = button->get_label();
 
-      Glib::RefPtr<Gtk::IconTheme> icon_theme = Gtk::IconTheme::get_for_screen(canvas->get_screen());
+      auto icon_theme = Gtk::IconTheme::get_for_screen(canvas->get_screen());
       int width = 0;
       int height = 0; //ignored
       Gtk::IconSize::lookup(Gtk::ICON_SIZE_DIALOG, width, height);
diff --git a/examples/book/toolpalette/examplewindow.cc b/examples/book/toolpalette/examplewindow.cc
index 45e3634..016dca0 100644
--- a/examples/book/toolpalette/examplewindow.cc
+++ b/examples/book/toolpalette/examplewindow.cc
@@ -21,7 +21,7 @@
 
 void ExampleWindow::load_icon_items()
 {
-  Glib::RefPtr<Gtk::IconTheme> icon_theme = Gtk::IconTheme::get_for_screen(get_screen());
+  auto icon_theme = Gtk::IconTheme::get_for_screen(get_screen());
 
   typedef std::vector<Glib::ustring> type_stringvec;
   type_stringvec icon_names = icon_theme->list_icons();
@@ -66,8 +66,8 @@ void ExampleWindow::load_icon_items()
           pixbuf->get_height() > 2*requested_icon_size)
         continue;
 
-      Gtk::Image* image = Gtk::manage(new Gtk::Image(pixbuf));
-      Gtk::ToolButton* button = Gtk::manage(new Gtk::ToolButton(*image, icon_name));
+      auto image = Gtk::manage(new Gtk::Image(pixbuf));
+      auto button = Gtk::manage(new Gtk::ToolButton(*image, icon_name));
       button->set_tooltip_text(icon_name);
       button->set_is_important();
       group->insert(*button);
@@ -83,7 +83,7 @@ void ExampleWindow::load_icon_items()
 
 void ExampleWindow::load_toggle_items()
 {
-  Gtk::ToolItemGroup* group = 
+  auto group = 
     Gtk::manage(new Gtk::ToolItemGroup("Radio Item"));
   m_ToolPalette.add(*group);
 
@@ -92,7 +92,7 @@ void ExampleWindow::load_toggle_items()
   for(int i = 1; i <= 10; ++i)
   {
     const Glib::ustring label = Glib::ustring::compose("#%1", i);
-    Gtk::RadioToolButton* button = Gtk::manage(new Gtk::RadioToolButton());
+    auto button = Gtk::manage(new Gtk::RadioToolButton());
     button->set_group(radio_group);
     button->set_label(label);
    
@@ -103,11 +103,11 @@ void ExampleWindow::load_toggle_items()
 
 static Gtk::ToolItem* create_entry_item(const Glib::ustring& text)
 {
-  Gtk::Entry* entry = Gtk::manage(new Gtk::Entry());
+  auto entry = Gtk::manage(new Gtk::Entry());
   entry->set_text(text);
   entry->set_width_chars(5);
 
-  Gtk::ToolItem* item = Gtk::manage(new Gtk::ToolItem());
+  auto item = Gtk::manage(new Gtk::ToolItem());
   item->add(*entry);
 
   return item;
@@ -115,14 +115,14 @@ static Gtk::ToolItem* create_entry_item(const Glib::ustring& text)
 
 void ExampleWindow::load_special_items()
 {
-  Gtk::ToolItemGroup* group = Gtk::manage(new Gtk::ToolItemGroup());
+  auto group = Gtk::manage(new Gtk::ToolItemGroup());
 
   Gtk::Button *label_button = Gtk::manage(new Gtk::Button("Advanced Features"));
   label_button->show();
   group->set_label_widget(*label_button);
   m_ToolPalette.add(*group);
 
-  Gtk::ToolItem* item = create_entry_item ("homogeneous=false");
+  auto item = create_entry_item ("homogeneous=false");
   group->insert(*item);
   //TODO: Add Gtk::Container::set_child_property().
   gtk_container_child_set (GTK_CONTAINER (group->gobj()), GTK_WIDGET (item->gobj()),
diff --git a/examples/book/toolpalette/main.cc b/examples/book/toolpalette/main.cc
index 46eba18..203128a 100644
--- a/examples/book/toolpalette/main.cc
+++ b/examples/book/toolpalette/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/tooltips/main.cc b/examples/book/tooltips/main.cc
index 8c2e7a7..00f46d7 100644
--- a/examples/book/tooltips/main.cc
+++ b/examples/book/tooltips/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/treeview/combo_renderer/examplewindow.cc 
b/examples/book/treeview/combo_renderer/examplewindow.cc
index fb28282..cc175d4 100644
--- a/examples/book/treeview/combo_renderer/examplewindow.cc
+++ b/examples/book/treeview/combo_renderer/examplewindow.cc
@@ -94,9 +94,9 @@ ExampleWindow::ExampleWindow()
   m_TreeView.append_column("Name", m_Columns.m_col_name);
 
   //Create a Combo CellRenderer, instead of the default Text CellRenderer:
-  Gtk::TreeView::Column* pColumn = Gtk::manage(
+  auto pColumn = Gtk::manage(
           new Gtk::TreeView::Column("Item Chosen") ); 
-  Gtk::CellRendererCombo* pRenderer = Gtk::manage(
+  auto pRenderer = Gtk::manage(
           new Gtk::CellRendererCombo);
   pColumn->pack_start(*pRenderer);
   m_TreeView.append_column(*pColumn);
diff --git a/examples/book/treeview/combo_renderer/main.cc b/examples/book/treeview/combo_renderer/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/treeview/combo_renderer/main.cc
+++ b/examples/book/treeview/combo_renderer/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/treeview/drag_and_drop/main.cc b/examples/book/treeview/drag_and_drop/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/treeview/drag_and_drop/main.cc
+++ b/examples/book/treeview/drag_and_drop/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/treeview/drag_and_drop/treemodel_dnd.cc 
b/examples/book/treeview/drag_and_drop/treemodel_dnd.cc
index e9693ac..3760847 100644
--- a/examples/book/treeview/drag_and_drop/treemodel_dnd.cc
+++ b/examples/book/treeview/drag_and_drop/treemodel_dnd.cc
@@ -41,7 +41,7 @@ TreeModel_Dnd::row_draggable_vfunc(const Gtk::TreeModel::Path& path) const
   // be dragged:
 
   //TODO: Add a const version of get_iter to TreeModel:
-  TreeModel_Dnd* unconstThis = const_cast<TreeModel_Dnd*>(this);
+  auto unconstThis = const_cast<TreeModel_Dnd*>(this);
   const_iterator iter = unconstThis->get_iter(path);
   //const_iterator iter = get_iter(path);
   if(iter)
@@ -76,7 +76,7 @@ TreeModel_Dnd::row_drop_possible_vfunc(const Gtk::TreeModel::Path& dest,
     //We must unconst this. This should not be necessary with a future version
     //of gtkmm.
     //TODO: Add a const version of get_iter to TreeModel:
-    TreeModel_Dnd* unconstThis = const_cast<TreeModel_Dnd*>(this);
+    auto unconstThis = const_cast<TreeModel_Dnd*>(this);
     const_iterator iter_dest_parent = unconstThis->get_iter(dest_parent);
     //const_iterator iter_dest_parent = get_iter(dest);
     if(iter_dest_parent)
@@ -93,7 +93,7 @@ TreeModel_Dnd::row_drop_possible_vfunc(const Gtk::TreeModel::Path& dest,
   //TODO: Add const version of get_from_selection_data(): Glib::RefPtr<const
   //Gtk::TreeModel> refThis = Glib::RefPtr<const Gtk::TreeModel>(this);
   //
-  //Glib::RefPtr<Gtk::TreeModel> refThis =
+  //auto refThis =
   //Glib::RefPtr<Gtk::TreeModel>(const_cast<TreeModel_Dnd*>(this));
   //refThis->reference(); //, true /* take_copy */)
   //Gtk::TreeModel::Path path_dragged_row;
diff --git a/examples/book/treeview/editable_cells/examplewindow.cc 
b/examples/book/treeview/editable_cells/examplewindow.cc
index 14a517a..fc7e00e 100644
--- a/examples/book/treeview/editable_cells/examplewindow.cc
+++ b/examples/book/treeview/editable_cells/examplewindow.cc
@@ -151,10 +151,10 @@ void ExampleWindow::cellrenderer_validated_on_editing_started(
   if(m_validate_retry)
   {
     //This is the CellEditable inside the CellRenderer. 
-    Gtk::CellEditable* celleditable_validated = cell_editable;
+    auto celleditable_validated = cell_editable;
 
     //It's usually an Entry, at least for a CellRendererText:
-    Gtk::Entry* pEntry = dynamic_cast<Gtk::Entry*>(celleditable_validated);
+    auto pEntry = dynamic_cast<Gtk::Entry*>(celleditable_validated);
     if(pEntry)
     {
       pEntry->set_text(m_invalid_text_for_retry);
diff --git a/examples/book/treeview/editable_cells/main.cc b/examples/book/treeview/editable_cells/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/treeview/editable_cells/main.cc
+++ b/examples/book/treeview/editable_cells/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/treeview/filter/examplewindow.cc b/examples/book/treeview/filter/examplewindow.cc
index f34a614..19a063e 100644
--- a/examples/book/treeview/filter/examplewindow.cc
+++ b/examples/book/treeview/filter/examplewindow.cc
@@ -89,7 +89,7 @@ ExampleWindow::ExampleWindow()
   //finely control column drag and drop.
   for(guint i = 0; i < 2; i++)
   {
-    Gtk::TreeView::Column* pColumn = m_TreeView.get_column(i);
+    auto pColumn = m_TreeView.get_column(i);
     pColumn->set_reorderable();
   }
 
diff --git a/examples/book/treeview/filter/main.cc b/examples/book/treeview/filter/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/treeview/filter/main.cc
+++ b/examples/book/treeview/filter/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/treeview/filter_modify/examplewindow.cc 
b/examples/book/treeview/filter_modify/examplewindow.cc
index bc52abb..df23285 100644
--- a/examples/book/treeview/filter_modify/examplewindow.cc
+++ b/examples/book/treeview/filter_modify/examplewindow.cc
@@ -84,7 +84,7 @@ ExampleWindow::ExampleWindow()
   //finely control column drag and drop.
   for(guint i = 0; i < 2; i++)
   {
-    Gtk::TreeView::Column* pColumn = m_TreeView.get_column(i);
+    auto pColumn = m_TreeView.get_column(i);
     pColumn->set_reorderable();
   }
 
diff --git a/examples/book/treeview/filter_modify/main.cc b/examples/book/treeview/filter_modify/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/treeview/filter_modify/main.cc
+++ b/examples/book/treeview/filter_modify/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/treeview/list/examplewindow.cc b/examples/book/treeview/list/examplewindow.cc
index 8c807c5..c70eafe 100644
--- a/examples/book/treeview/list/examplewindow.cc
+++ b/examples/book/treeview/list/examplewindow.cc
@@ -76,9 +76,9 @@ ExampleWindow::ExampleWindow()
           "%010d" /* 10 digits, using leading zeroes. */);
 
   //Display a progress bar instead of a decimal number:
-  Gtk::CellRendererProgress* cell = Gtk::manage(new Gtk::CellRendererProgress);
+  auto cell = Gtk::manage(new Gtk::CellRendererProgress);
   int cols_count = m_TreeView.append_column("Some percentage", *cell);
-  Gtk::TreeViewColumn* pColumn = m_TreeView.get_column(cols_count - 1);
+  auto pColumn = m_TreeView.get_column(cols_count - 1);
   if(pColumn)
   {
     pColumn->add_attribute(cell->property_value(), m_Columns.m_col_percentage);
@@ -90,7 +90,7 @@ ExampleWindow::ExampleWindow()
   //finely control column drag and drop.
   for(guint i = 0; i < 2; i++)
   {
-    Gtk::TreeView::Column* column = m_TreeView.get_column(i);
+    auto column = m_TreeView.get_column(i);
     column->set_reorderable();
   }
 
diff --git a/examples/book/treeview/list/main.cc b/examples/book/treeview/list/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/treeview/list/main.cc
+++ b/examples/book/treeview/list/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/treeview/listviewtext/main.cc b/examples/book/treeview/listviewtext/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/treeview/listviewtext/main.cc
+++ b/examples/book/treeview/listviewtext/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/treeview/modelsort/main.cc b/examples/book/treeview/modelsort/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/treeview/modelsort/main.cc
+++ b/examples/book/treeview/modelsort/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/treeview/popup/main.cc b/examples/book/treeview/popup/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/treeview/popup/main.cc
+++ b/examples/book/treeview/popup/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/treeview/popup/treeview_withpopup.cc 
b/examples/book/treeview/popup/treeview_withpopup.cc
index 0abe9c5..4d45292 100644
--- a/examples/book/treeview/popup/treeview_withpopup.cc
+++ b/examples/book/treeview/popup/treeview_withpopup.cc
@@ -43,7 +43,7 @@ TreeView_WithPopup::TreeView_WithPopup()
   append_column("Name", m_Columns.m_col_name);
 
   //Fill popup menu:
-  Gtk::MenuItem* item = Gtk::manage(new Gtk::MenuItem("_Edit", true));
+  auto item = Gtk::manage(new Gtk::MenuItem("_Edit", true));
   item->signal_activate().connect(
     sigc::mem_fun(*this, &TreeView_WithPopup::on_menu_file_popup_generic) );
   m_Menu_Popup.append(*item);
@@ -87,7 +87,7 @@ void TreeView_WithPopup::on_menu_file_popup_generic()
 {
   std::cout << "A popup menu item was selected." << std::endl;
 
-  Glib::RefPtr<Gtk::TreeView::Selection> refSelection = get_selection();
+  auto refSelection = get_selection();
   if(refSelection)
   {
     Gtk::TreeModel::iterator iter = refSelection->get_selected();
diff --git a/examples/book/treeview/tree/main.cc b/examples/book/treeview/tree/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/treeview/tree/main.cc
+++ b/examples/book/treeview/tree/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/book/update_ui/main.cc b/examples/book/update_ui/main.cc
index 3c36987..3885f2d 100644
--- a/examples/book/update_ui/main.cc
+++ b/examples/book/update_ui/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
 
diff --git a/examples/others/arrow/arrow.cc b/examples/others/arrow/arrow.cc
index bcc9a6d..d43f09d 100644
--- a/examples/others/arrow/arrow.cc
+++ b/examples/others/arrow/arrow.cc
@@ -94,7 +94,7 @@ AppWindow::~AppWindow()
 
 int main (int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
   AppWindow arrows;
 
   return app->run(arrows);
diff --git a/examples/others/calendar/calendar.cc b/examples/others/calendar/calendar.cc
index 3f71599..a8cfa38 100644
--- a/examples/others/calendar/calendar.cc
+++ b/examples/others/calendar/calendar.cc
@@ -166,22 +166,22 @@ CalendarExample::CalendarExample()
 
   set_resizable(false);
 
-  Gtk::Box* vbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL, DEF_PAD));
+  auto vbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL, DEF_PAD));
   add(*vbox);
 
   /*
    * The top part of the CalendarExample, flags and fontsel.
    */
 
-  Gtk::Box* hbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL, DEF_PAD));
+  auto hbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL, DEF_PAD));
   vbox->pack_start(*hbox, Gtk::PACK_EXPAND_WIDGET, DEF_PAD);
-  Gtk::ButtonBox* hbbox = Gtk::manage(new Gtk::ButtonBox());
+  auto hbbox = Gtk::manage(new Gtk::ButtonBox());
   hbox->pack_start(*hbbox, Gtk::PACK_SHRINK, DEF_PAD);
   hbbox->set_layout(Gtk::BUTTONBOX_SPREAD);
   hbbox->set_spacing(5);
 
   /* Calendar widget */
-  Gtk::Frame* frame = Gtk::manage(new Gtk::Frame("Calendar"));
+  auto frame = Gtk::manage(new Gtk::Frame("Calendar"));
   hbbox->pack_start(*frame, Gtk::PACK_EXPAND_WIDGET, DEF_PAD);
   calendar_ = new Gtk::Calendar();
   set_flags();
@@ -191,17 +191,17 @@ CalendarExample::CalendarExample()
   calendar_->signal_day_selected().connect(sigc::mem_fun(*this, &CalendarExample::day_selected));
   calendar_->signal_day_selected_double_click().connect(sigc::mem_fun(*this, 
&CalendarExample::day_selected_double_click));
 
-  Gtk::Separator* separator = Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_VERTICAL));
+  auto separator = Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_VERTICAL));
   hbox->pack_start (*separator, Gtk::PACK_SHRINK);
 
-  Gtk::Box* vbox2 = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL, DEF_PAD));
+  auto vbox2 = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL, DEF_PAD));
   hbox->pack_start(*vbox2, Gtk::PACK_SHRINK, DEF_PAD);
   
   /* Build the Right frame with the flags in */ 
 
-  Gtk::Frame* frameFlags = Gtk::manage(new Gtk::Frame("Flags"));
+  auto frameFlags = Gtk::manage(new Gtk::Frame("Flags"));
   vbox2->pack_start(*frameFlags, Gtk::PACK_EXPAND_WIDGET, DEF_PAD);
-  Gtk::Box* vbox3 = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL, DEF_PAD_SMALL));
+  auto vbox3 = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL, DEF_PAD_SMALL));
   frameFlags->add(*vbox3);
 
   struct {
@@ -217,7 +217,7 @@ CalendarExample::CalendarExample()
 
   for (int i = 0; i < 5; i++)
   {
-    Gtk::CheckButton* toggle = new Gtk::CheckButton(flags[i].label);
+    auto toggle = new Gtk::CheckButton(flags[i].label);
     toggle->signal_toggled().connect(sigc::bind(sigc::mem_fun(*this, &CalendarExample::toggle_flag), 
toggle));
     vbox3->pack_start(*toggle);
     flag_checkboxes_[i] = toggle;
@@ -231,7 +231,7 @@ CalendarExample::CalendarExample()
   // Add a StyleProvider to the Gtk::Calendar, so we can change the font.
   // This was easier before Gtk::Widget::override_font() was deprecated.
   css_provider_ = Gtk::CssProvider::create();
-  Glib::RefPtr<Gtk::StyleContext> refStyleContext = calendar_->get_style_context();
+  auto refStyleContext = calendar_->get_style_context();
   refStyleContext->add_provider(css_provider_, GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
   css_provider_->signal_parsing_error().connect(
     sigc::mem_fun(*this, &CalendarExample::on_parsing_error));
@@ -249,7 +249,7 @@ CalendarExample::CalendarExample()
   
   hbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL, 5));
   vbox2->pack_start (*hbox, Gtk::PACK_SHRINK);
-  Gtk::Label* label = Gtk::manage(new Gtk::Label("Day selected:"));
+  auto label = Gtk::manage(new Gtk::Label("Day selected:"));
   hbox->pack_start (*label, Gtk::PACK_SHRINK);
   label_selected_ = new Gtk::Label("");
   hbox->pack_start (*label_selected_, Gtk::PACK_SHRINK);
@@ -268,11 +268,11 @@ CalendarExample::CalendarExample()
   label_month_ = new Gtk::Label("");
   hbox->pack_start(*label_month_, Gtk::PACK_SHRINK);
   
-  Gtk::ButtonBox* bbox = Gtk::manage(new Gtk::ButtonBox());
+  auto bbox = Gtk::manage(new Gtk::ButtonBox());
   vbox->pack_start(*bbox, Gtk::PACK_SHRINK);
   bbox->set_layout(Gtk::BUTTONBOX_END);
 
-  Gtk::Button* button = Gtk::manage(new Gtk::Button("Close"));
+  auto button = Gtk::manage(new Gtk::Button("Close"));
   button->signal_clicked().connect(
     sigc::mem_fun(*this, &CalendarExample::on_button_close));
   bbox->add(*button);
@@ -293,7 +293,7 @@ Glib::Date CalendarExample::get_date() const
 
 int main(int argc, char** argv)
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
   CalendarExample calendar;
   return app->run(calendar);
 }
diff --git a/examples/others/cellrenderercustom/cellrendererlist.cc 
b/examples/others/cellrenderercustom/cellrendererlist.cc
index 728b59d..122f36c 100644
--- a/examples/others/cellrenderercustom/cellrendererlist.cc
+++ b/examples/others/cellrenderercustom/cellrendererlist.cc
@@ -51,7 +51,7 @@ CellRendererList::CellRendererList()
   tree_view_.signal_button_release_event().connect(
       sigc::mem_fun(*this, &Self::on_tree_view_button_release_event));
 
-  const Glib::RefPtr<Gtk::TreeSelection> selection = tree_view_.get_selection();
+  const auto selection = tree_view_.get_selection();
   selection->set_mode(Gtk::SELECTION_BROWSE);
   selection->signal_changed().connect(sigc::mem_fun(*this, &Self::on_tree_selection_changed));
 
diff --git a/examples/others/cellrenderercustom/cellrenderertoggle.cc 
b/examples/others/cellrenderercustom/cellrenderertoggle.cc
index 1ac0a30..c86193b 100644
--- a/examples/others/cellrenderercustom/cellrenderertoggle.cc
+++ b/examples/others/cellrenderercustom/cellrenderertoggle.cc
@@ -288,7 +288,7 @@ void AppWindow::on_cell_toggled(const Glib::ustring& path_string)
 
 int main(int argc, char** argv)
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   AppWindow window;
   app->run(window);
diff --git a/examples/others/cellrenderercustom/testpopup.cc b/examples/others/cellrenderercustom/testpopup.cc
index ad811be..94946b9 100644
--- a/examples/others/cellrenderercustom/testpopup.cc
+++ b/examples/others/cellrenderercustom/testpopup.cc
@@ -110,7 +110,7 @@ void AppWindow::on_cell_edited(const Glib::ustring& path, const Glib::ustring& n
 
 int main(int argc, char** argv)
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   AppWindow window;
   app->run(window);
diff --git a/examples/others/dnd/dndwindow.cc b/examples/others/dnd/dndwindow.cc
index 8d1aedb..f0f2f66 100644
--- a/examples/others/dnd/dndwindow.cc
+++ b/examples/others/dnd/dndwindow.cc
@@ -152,7 +152,7 @@ bool DnDWindow::on_image_drag_motion(const Glib::RefPtr<Gdk::DragContext>& conte
     m_Image.set(m_trashcan_open);
   }
 
-  Gtk::Widget* source_widget = Gtk::Widget::drag_get_source_widget(context);
+  auto source_widget = Gtk::Widget::drag_get_source_widget(context);
   g_print ("motion, source %s\n", source_widget ?
            G_OBJECT_TYPE_NAME (source_widget) :
            "NULL");
@@ -235,7 +235,7 @@ void DnDWindow::create_popup()
   m_PopupWindow.set_position(Gtk::WIN_POS_MOUSE);
 
   //Create Grid and fill it:
-  Gtk::Grid* pGrid = Gtk::manage(new Gtk::Grid());
+  auto pGrid = Gtk::manage(new Gtk::Grid());
 
   for(int i = 0; i < 3; i++)
   {
@@ -243,7 +243,7 @@ void DnDWindow::create_popup()
     {
       char buffer[128];
       g_snprintf(buffer, sizeof(buffer), "%d,%d", i, j);
-      Gtk::Button* pButton = Gtk::manage(new Gtk::Button(buffer));
+      auto pButton = Gtk::manage(new Gtk::Button(buffer));
       pGrid->attach(*pButton, i, j, 1, 1);
 
       pButton->drag_dest_set(m_listTargetsNoRoot, Gtk::DEST_DEFAULT_ALL, Gdk::DragAction(GDK_ACTION_COPY | 
GDK_ACTION_MOVE));
diff --git a/examples/others/dnd/main.cc b/examples/others/dnd/main.cc
index 4946dd8..91ee82e 100644
--- a/examples/others/dnd/main.cc
+++ b/examples/others/dnd/main.cc
@@ -21,7 +21,7 @@
 
 int main (int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   DnDWindow dndWindow;
   return app->run(dndWindow); //Shows the window and returns when it is closed.
diff --git a/examples/others/exception/exceptiontest.cc b/examples/others/exception/exceptiontest.cc
index 97b382d..69f4451 100644
--- a/examples/others/exception/exceptiontest.cc
+++ b/examples/others/exception/exceptiontest.cc
@@ -92,7 +92,7 @@ void handler2()
 
 int main(int argc, char** argv)
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
 
   Gtk::Window window;
diff --git a/examples/others/idle/idle.cc b/examples/others/idle/idle.cc
index 39144a2..567d767 100644
--- a/examples/others/idle/idle.cc
+++ b/examples/others/idle/idle.cc
@@ -97,7 +97,7 @@ bool IdleExample::idle_callback()
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   IdleExample example;
 
diff --git a/examples/others/statusbar/statusbar.cc b/examples/others/statusbar/statusbar.cc
index f5cc729..f6315cd 100644
--- a/examples/others/statusbar/statusbar.cc
+++ b/examples/others/statusbar/statusbar.cc
@@ -59,7 +59,7 @@ StatusBarExample::push_item(unsigned int context_id)
 
 int main (int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   StatusBarExample exampleWindow;
 
diff --git a/examples/others/tictactoe/tictactoe.cc b/examples/others/tictactoe/tictactoe.cc
index 11f50c4..9da6136 100644
--- a/examples/others/tictactoe/tictactoe.cc
+++ b/examples/others/tictactoe/tictactoe.cc
@@ -26,7 +26,7 @@
 TicTacToe::TicTacToe()
 : Gtk::Box(Gtk::ORIENTATION_VERTICAL)
 {
-  Gtk::Grid* grid = Gtk::manage( new Gtk::Grid() );
+  auto grid = Gtk::manage( new Gtk::Grid() );
   grid->set_row_homogeneous(true);
   grid->set_column_homogeneous(true);
   add( *grid);
diff --git a/examples/others/tictactoe/ttt_test.cc b/examples/others/tictactoe/ttt_test.cc
index 4dceaa0..0d9912e 100644
--- a/examples/others/tictactoe/ttt_test.cc
+++ b/examples/others/tictactoe/ttt_test.cc
@@ -14,9 +14,9 @@ win (TicTacToe *ttt)
 int
 main (int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
-  TicTacToe* ttt = manage( new TicTacToe );
+  auto ttt = manage( new TicTacToe );
   ttt->tictactoe.connect( sigc::bind (sigc::ptr_fun(&win), ttt) );
 
   Gtk::Window window;
diff --git a/examples/others/treemodelcustom/exampletreemodel.cc 
b/examples/others/treemodelcustom/exampletreemodel.cc
index 820abf2..1f8e42c 100644
--- a/examples/others/treemodelcustom/exampletreemodel.cc
+++ b/examples/others/treemodelcustom/exampletreemodel.cc
@@ -148,7 +148,7 @@ bool ExampleTreeModel::iter_next_vfunc(const iterator& iter, iterator& iter_next
     iter_next.set_stamp(m_stamp);
     
     //Get the current row:
-    const GlueItem* pItem = (const GlueItem*)iter.gobj()->user_data;
+    const auto pItem = (const GlueItem*)iter.gobj()->user_data;
     typeListOfRows::size_type row_index = pItem->get_row_number();
         
     //Make the iter_next GtkTreeIter represent the next row:
@@ -156,7 +156,7 @@ bool ExampleTreeModel::iter_next_vfunc(const iterator& iter, iterator& iter_next
     if( row_index < m_rows.size() )
     { 
       //Put the index of the next row in a GlueItem in iter_next:
-      GlueItem* pItemNew = new GlueItem(row_index);
+      auto pItemNew = new GlueItem(row_index);
       iter_next.gobj()->user_data = (void*)pItemNew;
 
       remember_glue_item(pItemNew);
@@ -218,7 +218,7 @@ bool ExampleTreeModel::iter_nth_root_child_vfunc(int n, iterator& iter) const
     unsigned row_index = n;
 
     //This will be deleted in the GlueList destructor, when old iterators are marked as invalid.
-    GlueItem* pItem = new GlueItem(row_index);
+    auto pItem = new GlueItem(row_index);
     iter.gobj()->user_data = pItem;
 
     remember_glue_item(pItem);
@@ -273,7 +273,7 @@ bool ExampleTreeModel::get_iter_vfunc(const Path& path, iterator& iter) const
    //TODO: Store a pointer to some more complex data type such as a typeListOfRows::iterator.
 
    unsigned row_index = path[0];
-   GlueItem* pItem = new GlueItem(row_index);
+   auto pItem = new GlueItem(row_index);
 
    //Store the GlueItem in the GtkTreeIter.
    //This will be deleted in the GlueList destructor,
@@ -294,7 +294,7 @@ Gtk::TreeModelColumn< Glib::ustring >& ExampleTreeModel::get_model_column(int co
 ExampleTreeModel::typeListOfRows::iterator ExampleTreeModel::get_data_row_iter_from_tree_row_iter(const 
iterator& iter)
 {
   //Don't call this on an invalid iter.
-  const GlueItem* pItem = (const GlueItem*)iter.gobj()->user_data;
+  const auto pItem = (const GlueItem*)iter.gobj()->user_data;
 
   typeListOfRows::size_type row_index = pItem->get_row_number();
   if( row_index > m_rows.size() )
@@ -306,7 +306,7 @@ ExampleTreeModel::typeListOfRows::iterator ExampleTreeModel::get_data_row_iter_f
 ExampleTreeModel::typeListOfRows::const_iterator 
ExampleTreeModel::get_data_row_iter_from_tree_row_iter(const iterator& iter) const
 {
   //Don't call this on an invalid iter.
-  const GlueItem* pItem = (const GlueItem*)iter.gobj()->user_data;
+  const auto pItem = (const GlueItem*)iter.gobj()->user_data;
   
   typeListOfRows::size_type row_index = pItem->get_row_number();
   if( row_index > m_rows.size() )
diff --git a/examples/others/treemodelcustom/main.cc b/examples/others/treemodelcustom/main.cc
index 5ed68e1..d442b3b 100644
--- a/examples/others/treemodelcustom/main.cc
+++ b/examples/others/treemodelcustom/main.cc
@@ -21,7 +21,7 @@
 
 int main(int argc, char *argv[])
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
   ExampleWindow window;
   return app->run(window); //Shows the window and returns when it is closed.
diff --git a/examples/others/window/wheelbarrow.cc b/examples/others/window/wheelbarrow.cc
index 0ec2179..f956368 100644
--- a/examples/others/window/wheelbarrow.cc
+++ b/examples/others/window/wheelbarrow.cc
@@ -155,7 +155,7 @@ Wheelbarrow::Wheelbarrow()
   //TODO: Use get_style_context() and Gdk::RGBA instead?
   const Gdk::Color transparent = Gtk::Widget::get_default_style()->get_bg(Gtk::STATE_NORMAL);
 
-  const Glib::RefPtr<Gdk::Pixbuf> pixbuf =
+  const auto pixbuf =
       Gdk::Pixbuf::create_from_xpm_data(drawable, transparent, wheelbarrow_xpm);
 
   Gtk::Image *const image = new Gtk::Image(pixbuf);
@@ -191,7 +191,7 @@ bool Wheelbarrow::on_button_press_event(GdkEventButton* event)
 
 int main(int argc, char** argv)
 {
-  Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
+  auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
 
 
   Wheelbarrow wheelbarrow;


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