Re: [sigc] Connect signal to a signal?



Folks,

From http://developer.gnome.org/libsigc++/stable/classsigc_1_1signal.html :
"If you want to connect one signal to another, use make_slot() to retrieve a functor that emits the signal when invoked."

So this can be done more nicely, with:
signal_a.connect(signal_b.make_slot());

Cheers,
-- 
hpreg

On Mar 9, 2012, at 6:32 PM, cheshirekow wrote:

> On Fri, 2012-03-09 at 16:49 +0000, Rui Maciel wrote:
>> Is there a way to connect a signal to another signal so that emitting 
>> signal A would cause signal B to be emitted?
> 
> Try this:
> 
> typedef sigc::signal<a,b,c> signal_b_t; // typeof(signal_b)
> signal_a.connect( sigc::mem_fun( signal_b, &signal_b_t::emit ) );
> 
>> 
>> 
>> Thanks in advance,
>> Rui Maciel
>> _______________________________________________
>> libsigc-list mailing list
>> libsigc-list gnome org
>> http://mail.gnome.org/mailman/listinfo/libsigc-list
> 
> 
> _______________________________________________
> libsigc-list mailing list
> libsigc-list gnome org
> http://mail.gnome.org/mailman/listinfo/libsigc-list



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