mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
CComponentsSignals: add signal OnError
This commit is contained in:
@@ -59,13 +59,18 @@ class CYourClass : sigc::trackable //<- not forget, requierd by destructor!
|
|||||||
// here we use a void* parameter, can be filled with any stuff you can cast, you can use also other types
|
// here we use a void* parameter, can be filled with any stuff you can cast, you can use also other types
|
||||||
void *vptr = yourStuff;
|
void *vptr = yourStuff;
|
||||||
|
|
||||||
//now we create a slot...
|
//Example for connection with member function
|
||||||
|
//now we can create a slot with a member function of this class
|
||||||
sigc::slot0<void> sl = sigc::bind<0>(sigc::mem_fun1(*this, &CYourClass::DoThis), vptr);
|
sigc::slot0<void> sl = sigc::bind<0>(sigc::mem_fun1(*this, &CYourClass::DoThis), vptr);
|
||||||
|
|
||||||
//...and connect with signal in the receiver object
|
//...and connect with signal in the receiver object
|
||||||
receiver.OnBeforePaint.connect(sl);
|
receiver.OnBeforePaint.connect(sl);
|
||||||
|
|
||||||
|
//example for single function
|
||||||
|
sigc::slot0<void> s2 = sigc::bind<0>(sigc::ptr_fun1(&DisplayErrorMessage), "test");
|
||||||
|
receiver.OnBeforePaint.connect(s2);
|
||||||
|
|
||||||
//thats' all. If DoThis(bla) is connected, OnBeforePaint is doing the same like the DoThis(), but in the foreign object
|
//thats' all. If DoThis(bla) is connected, OnBeforePaint is doing the same like the DoThis(), but in the foreign object
|
||||||
|
//for more details take a look into offical libsig2 documentation at http://libsigc.sourceforge.net/libsigc2/docs/
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
*/
|
*/
|
||||||
@@ -80,6 +85,7 @@ class CComponentsSignals : public sigc::trackable
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CComponentsSignals(){};
|
CComponentsSignals(){};
|
||||||
|
sigc::signal<void> OnError;
|
||||||
|
|
||||||
sigc::signal<void> OnBeforePaint;
|
sigc::signal<void> OnBeforePaint;
|
||||||
sigc::signal<void> OnAfterPaint;
|
sigc::signal<void> OnAfterPaint;
|
||||||
|
Reference in New Issue
Block a user