Events in D

bitwise via Digitalmars-d digitalmars-d at puremagic.com
Tue Aug 29 12:01:19 PDT 2017


On Tuesday, 29 August 2017 at 16:25:33 UTC, Jonathan Marler wrote:
> [...]
>

While responding to your question, I provided an example for 
needing access to the host's data members (Mutex), but failed to 
provide an example of needing an extra delegate-to-host for an 
event. I just hit that case though, and it's timers/animations.

For any app where battery life is a concern, you can't just spin 
for no reason. So when you add a handler to a timer/animation 
event, you have to kick off whatever timer handles the animation 
if it's not running. Likewise, you have to stop it when all 
events have been removed.


More information about the Digitalmars-d mailing list