Re: [gtkmm] Signal emission stop



>"Andrew E. Makeev" wrote:
>
> Look at the simple example below, and explain, please, how
> could I stop SigC signal emission?

Perhaps you can get the same effect by keeping the
SigC::Connection object (say con2) returned by the second
test_signal.connect method and then, inside fi(),
conditionally doing CON.disconnect();

Like this:

 some_method ()
 {
      test_signal.connect (SigC::slot (*this, &MyClass::f1));
SigC::Connection con2 =
      test_signal.connect (SigC::slot (*this, &MyClass::f2));
 }

 f1 ()
 {
     if (<expr> == true) con2.disconnect();
     else
 // ...
 }

 f2() { /* ... */ }



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