I want to use lambda expressions in connection with goocanvas in gtk++. For my understanding this means that I must be able to put my lambda in a sigc++ functor.
I tried something like that:
sigc::slot<bool, const Glib::RefPtr<Goocanvas::Item>& , GdkEventMotion* > slot2=
[]( const Glib::RefPtr<Goocanvas::Item>& item, GdkEventMotion* ev)->bool
{
cout << "Lambda " << endl; return false;
};
((Glib::RefPtr<Goocanvas::Item>&)item1)->signal_motion_notify_event().connect( slot2);
But this will not compile.
Is there a chance to get sigc working with lambdas or better gtkmm directly without the sigc++ intermediate :-)
I found the following code snipped which do the job. I have no idea how this interacts with the sigc++ lib, but I can use it for simple cases. Maybe someone else can take a look on it.
UPDATE: Libsigc is now able to handle lambas without any additional user code. The above code must be removed if any current versions is used.