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

Craig Black cblack at ara.com
Tue Dec 5 15:54:19 PST 2006


So you are satisfied with the functionality you have with your current 
design.  OK.  As far as the example that you cited, this seems to be a 
specific case.  In this case, would it not be a simple matter to maintain a 
reference to the object that you don't want to be deallocated?

-Craig

"Chris Miller" <chris at dprogramming.com> wrote in message 
news:op.tj3ns3mxpo9bzi at tanu...
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