How would you implement this in D? (signals & slots)
Gerald via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Tue Feb 2 09:36:47 PST 2016
On Tuesday, 2 February 2016 at 15:59:06 UTC, Atila Neves wrote:
> Slots are named: the methods are slots. Signals can be named if
> you use only one struct as the parameter, as above. The signals
> would be String1 and String2, the slots watch1 and watch2.
What I meant is that the connect call didn't seem to tie you to a
specific slot, it looked like it determined the slot based on the
types which is potentially error prone. Kagamin showed an example
of explicitly connecting to a named slot so I'm happy with that,
I'm looking forward to re-writing my event handlers using this
technique.
Always nice to learn something new.
More information about the Digitalmars-d-learn
mailing list