Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-03-03 12:58:48


Peter Dimov wrote:

> Vladimir Prus wrote:
>>
>> Where will you specify C++ code, e.g. methods like "draw"? In QT, XML
>> is converted to real C++ code that you can subclass and add behaviour
>> there. In Mozilla, XUL is scriptable via JavaScript.
>>
>> What can be done here?
>
> // create a xml archive, deserialize w
> widget w = create_widget("description.xml");

[...]

> 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.

Oh, so we need XML to be able to store not only some predefined widgets, but
also custom widgets. And to edit those custom widgets, we'd need GUI editor
which can understand plugning. We're getting close to duplicating
QDesigner ;-)

> // do nothing, a Python function is automatically attached to
> clicked_signal // Python should be able to see the widget as an object
> // Nontrivial

This sounds like a best solution. At least for dialogs, Python's performance
should not matter.

- Volodya


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