diff --git a/examples/book/timeout/timerexample.cc b/examples/book/timeout/timerexample.cc
index cc18555..94a98b7 100644
--- a/examples/book/timeout/timerexample.cc
+++ b/examples/book/timeout/timerexample.cc
@@ -60,8 +60,10 @@ void TimerExample::on_button_add_timer()
               &TimerExample::on_timeout), m_timer_number);
 
   // This is where we connect the slot to the Glib::signal_timeout()
-  sigc::connection conn = Glib::signal_timeout().connect(my_slot,
-          timeout_value);
+  const Glib::RefPtr<Glib::TimeoutSource> timeout_source =
+    Glib::TimeoutSource::create(timeout_value);
+  sigc::connection conn = timeout_source->connect(my_slot);
+  timeout_source->attach(Glib::MainContext::get_default());
 
   // Remember the connection:
   m_timers[m_timer_number] = conn;
