[gtkmm-documentation] custom_container example: Update overriding Container::forall_vfunc()



commit 7a398b9040593fec6dbb77cb66c7dcaa17747abc
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date:   Fri Dec 30 15:12:06 2016 +0100

    custom_container example: Update overriding Container::forall_vfunc()
    
    Container::forall_vfunc() has been changed in gtkmm. Change the overriding
    vfunc in MyContainer accordingly.

 .../book/custom/custom_container/mycontainer.cc    |   10 +++++-----
 .../book/custom/custom_container/mycontainer.h     |    2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/examples/book/custom/custom_container/mycontainer.cc 
b/examples/book/custom/custom_container/mycontainer.cc
index 97ef9d7..7107754 100644
--- a/examples/book/custom/custom_container/mycontainer.cc
+++ b/examples/book/custom/custom_container/mycontainer.cc
@@ -181,13 +181,13 @@ void MyContainer::on_size_allocate(Gtk::Allocation& allocation)
     m_child_two->size_allocate(child_allocation_two);
 }
 
-void MyContainer::forall_vfunc(gboolean, GtkCallback callback, gpointer callback_data)
+void MyContainer::forall_vfunc(bool /* include_internals */, const ForeachSlot& slot)
 {
-  if(m_child_one)
-    callback(m_child_one->gobj(), callback_data);
+  if (m_child_one)
+    slot(*m_child_one);
 
-  if(m_child_two)
-    callback(m_child_two->gobj(), callback_data);
+  if (m_child_two)
+    slot(*m_child_two);
 }
 
 void MyContainer::on_add(Gtk::Widget* child)
diff --git a/examples/book/custom/custom_container/mycontainer.h 
b/examples/book/custom/custom_container/mycontainer.h
index 2758eb3..254ec17 100644
--- a/examples/book/custom/custom_container/mycontainer.h
+++ b/examples/book/custom/custom_container/mycontainer.h
@@ -35,7 +35,7 @@ protected:
     int& minimum_baseline, int& natural_baseline) const override;
   void on_size_allocate(Gtk::Allocation& allocation) override;
 
-  void forall_vfunc(gboolean include_internals, GtkCallback callback, gpointer callback_data) override;
+  void forall_vfunc(bool include_internals, const ForeachSlot& slot) override;
 
   void on_add(Gtk::Widget* child) override;
   void on_remove(Gtk::Widget* child) override;


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