Boost logo

Boost :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2003-02-19 11:03:00


On Wednesday 19 February 2003 09:37 am, Peter Dimov wrote:
> You'll soon find that this is not _that_ easier to use compared to
>
> setEventHandler(bind(&CButton::OnPaint, this));
>
> and the latter is much more flexible:
>
> setEventHandler(bind(&CButton::OnMessage, this, WM_PAINT));
>
> but that's another story. :-)

... and if you decide to go down that road, you'll likely want to write
setEventHandler like this:

void setEventHandler(const boost::function0<long>& handler)
{
  // add event handler to std::map
}

        Doug


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk