|
Boost : |
From: E. Gladyshev (eegg_at_[hidden])
Date: 2004-03-08 03:39:44
From: "Douglas Paul Gregor" <gregod_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Sunday, March 07, 2004 8:22 PM
Subject: Re: [boost] enumeration interface for boost::signals
[...]
> No, it wasn't. What sort of application do you need it for? It's
> interesting.
I am trying to use boost::signals in my GUI project.
The capturing feature is needed when
a window has many separate regions (each region is a slot)
and a region wants to capture all mouse events after the mouse enters
this region. It is a very typical situation.
The ability to enumerate slots in a defined order is
necessary for building something similar to callback chains.
For instance, in Win32 you can insert your window callback
function into the existing chain.
Something like
callback prev_cb;
void my_callback()
{
if( some condition )
{
prev_cb(); //propagate the signal futher
do_something1();
}
else
{
do_something2();
return; //stop signal propagation
}
}
main()
{
window w;
prev_cb = register_callback(w, my_callback)
}
I am not sure what's the best way to implement something like this with
boost::signals.
It seems to me that we need a finer control over the slots.
Eugene
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk