|
Boost : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2004-03-03 13:34:50
Vladimir Prus wrote:
> Peter Dimov wrote:
>
>> button b = cast<button>( w->find_by_name("my_button") );
>> b->clicked_signal = my_callback;
>
> Aha, and that requires that all functionality is implemented as
> standalone functions. This might be okay for clicking buttons,
> but for custom widgets (e.g. text editor), I'd still prefer subclassing.
Are you sure that you do? The equivalent of
b1->clicked_signal = my_callback_1;
b2->clicked_signal = my_callback_2;
b3->clicked_signal = my_callback_3;
would require three new 'button' subclasses. Even if the above requires
three brand new functions to be written (which is rarely the case, I usually
boost::bind existing functions), it's still less code.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk