Re: sigc++ signals and GSignal



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Luca Cappa <luca cappa i-medlab com> writes:

> Murray Cumming wrote:
>>>With sigc::signal, I can only run signals in the order they were
>>>connected.  I'd like to mimic GSignal, in that I want to provide a
>>>default implementation which may be overridden, but if overridden, I
>>>might not want the default to run at all.  Is this possible?
>> Not easily. You could connect ane empty virtual member method as a
>> default handler to your member signal. But making sure that it
>> would be run before or after other handlers would be
>> difficult. Maybe you could play with the signal's slot_list<> to
>> change the calling sequence.
>
> i guess that to add an handler after or before you could play with
> the "after" argument of that Glib::SignalProxyNormal::connect (const
> sigc::slot_base& slot, bool after) method.

I think on reflection I'll be better with just virtual functions.  I
wanted to mimic GSignal, but since I'm not wrapping a real GSignal, I
can't make use of SignalProxyNormal.  I'd also rather not mess with
the slot_list<> unless really necessary.

Thanks for the suggestions, though!

Regards,
Roger

- -- 
Roger Leigh
                Printing on GNU/Linux?  http://gimp-print.sourceforge.net/
                Debian GNU/Linux        http://www.debian.org/
                GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8+ <http://mailcrypt.sourceforge.net/>

iD4DBQFDqTtAVcFcaSW/uEgRAqZbAJjlSWJhs+cFxEaWvoqen7t7DE76AKDv9DVG
aiAcgOQBO/YEVEoWQNeFLQ==
=joDm
-----END PGP SIGNATURE-----



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