View Full Version : Connect to signals

04-10-2007, 09:32 PM
When using a SlotContainer with the CL_Keyboard and CL_Mouse signals I get the error:

error: no matching function for call to CL_SlotContainer::connect(CL_Signal_v1<const CL_InputEvent&>&, void (*)(const CL_InputEvent&))'

For the following code:

slots.connect(window->sig_window_close(), &Core::on_window_close);
slots.connect(CL_Keyboard::sig_key_down(), &Core::on_key_down);

The first line works fine, but the second produces the error.

Thanks, Dom.

04-11-2007, 06:38 AM
How does your on_key_down function look like?

04-11-2007, 02:23 PM
The receiving code is this:

void Core::on_key_down(const CL_InputEvent& e);

Which works for

slot_key_down = CL_Keyboard::sig_key_down().connect(&Core::on_key_down);

but not for the CL_SlotContainer.