Re: slots & callbacks



Arun Thomas wrote:
> 
>    I sent to this to the gtkmm list and the libsigc list, but no one has
> been able to help. This post isn't really C++-centric. It has more to with
> slots and callbacks.
>    I created a ComboWCB class with
> a member function called Callback. This class is derived from the
> Combo class. I then write:
> 
> ComboWCB *NewCombo = manage(new ComboWCB);
> ...
> NewCombo->get_popwin()->unmap_event.connect(
> slot(NewCombo, &ComboWCB::Callback) );
> 
> The prototype for ComboWCB::Callback is as follows:
> void Callback(GdkEventAny *Event);
> 
>    I get an error on the last line. The compiler complains that
> there is no matching function: no matching function for call to
> '::Gtk::::Gtk::EmitProxySignal1<int,_GdkEventAny
> *,::Gtk::Widget,_GtkWidget,30,gtkmm_widget_unmap_event(GtkWidget *,
> GdkEventAny *)>::connect (::SigC::::SigC::Slot1<void,_GdkEventAny *>)'
> /usr/local/include/gtk--/proxy.h:208: candidates are:
> ::Gtk::::Gtk::ProxySignal1<int, _GdkEventAny
> *,::Gtk::Widget,_GtkWidget,30>::connect<gint, GdkEventAny *, ::Gtk::Widget,
> GtkWidget, 30>(const ::SigC::::SigC::Slot1(int,_GdkEventAny *> &)
> 

Gotta love those C++ compiler error messages. About as useful as tits on
a bull...

I _think_ it's griping because your method has a parameter. Try removing
the parameter from Callback (So it just expects nothing) and see if that
doesn't fix the problem.

-- 
Bruce Ide                                           
bruce.ide@echostar.com
"GP: Is Eris True?" "M2: Everything is true." "GP: Even false things?"
"M2: Even false things are true." "GP: How can that be?" "M2: I don't 
know, man. I didn't do it."




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