![]() |
![]() |
Compounds | |
class | slot |
Converts an arbitrary functor to a unified type which is opaque. More... | |
class | slot_base |
Base type for slots. More... |
A Slot can be constructed from any function, regardless of whether it is a global function, a member method, static, or virtual.
Use the sigc::mem_fun() and sigc::ptr_fun() template functions to get a sigc::slot, like so:
sigc::slot<void, int> sl = sigc::mem_fun(someobj,& SomeClass::somemethod);
sigc::slot<void, int> sl = sigc::ptr_fun(&somefunction);
m_Button.signal_clicked().connect( sigc::mem_fun(*this, &MyWindow::on_button_clicked) );
You can also pass slots as method parameters where you might normally pass a function pointer.