#include <gtkmm/action.h>
#include <gtkmm/actiongroup.h>
#include <gtkmm/main.h>
#include <gtkmm/stock.h>
#include <iostream>

using namespace std;
using namespace Glib;
using namespace Gtk;

#define I_WANT_A_WARNING 1

class Test : public Glib::Object
{
public:
   Test();
   ~Test() { cout << "delete Test" << endl; }

   void DoNothing(Glib::RefPtr<Action> action) {}
};


Test::Test()
{
   cout << "new Test" << endl;

   Glib::RefPtr<Action> action(Action::create("Wubble"));

   Glib::RefPtr<ActionGroup> group(ActionGroup::create("new group"));

   group->add(action, sigc::bind(sigc::mem_fun(this, &Test::DoNothing),
#if I_WANT_A_WARNING
                                 action));
#else
                                 sigc::ref(action)));
#endif
}


void test(void)
{
   Glib::RefPtr<Test> ptr(new Test());

   Main::quit();
}


int main(int argc, char **argv)
{
   Main myMain(argc, argv);

   myMain.signal_run().connect(sigc::ptr_fun(&test));

   myMain.run();

   return 0;
}
