#include <gtkmm.h>

class MyWindow : public Gtk::Window
{
public:
  MyWindow();

private:
  void OnChildRemoved(Widget *child);

  Gtk::Button b;
  Gtk::VBox vbox;
};

MyWindow::MyWindow() : 
  b("hello"),
  vbox()
{
  add(vbox);
  vbox.pack_start(b);
  show_all_children();

  signal_remove().connect(
     sigc::mem_fun(this, &MyWindow::OnChildRemoved));
}

void
MyWindow::OnChildRemoved(Widget *child)
{
  g_print("Child removed\n");
}

int main (int argc, char *argv[])
{
  Gtk::Main kit(argc, argv);
  
  MyWindow window;
  kit.run(window);

  return 0;
}
