Are any GUI libs going to make use of signals/slots?

Chris Miller chris at dprogramming.com
Tue Dec 5 10:47:16 PST 2006


On Tue, 05 Dec 2006 12:38:37 -0500, Craig Black <cblack at ara.com> wrote:

> Is anybody using or planning to use the new signal/slot feature?  Seems  
> like
> a powerful feature to me.  I'm curious as to its percieved utility to GUI
> library maintainers.
>
> -Craig
>

DFL has had something like it all along; just use D's ~= cat-assign  
operator to attach as many event handlers (delegates) as you want.

The thing is though, that I don't think I want to use std.signals because  
I actually like that, with DFL's events, an object won't be destructed by  
the GC if one of the object's member functions is added as an event  
handler.
For example, take a timer: I have an object and want one of its members  
called back every second, so I add it to a timer's event; I don't want my  
object destructed just because I'm not referencing it anymore, I still  
have the timer setup and want to rely on it to keep on ticking with my  
live object.
If the timer were to stop and be destructed, then yes, all bets are off  
and my object can be destructed.

- Chris



More information about the Digitalmars-d-dwt mailing list