Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2004-03-03 12:18:45


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");

// case 1

window w2 = cast<window>(w);
grid g = cast<grid>(w2->at(0));
button b = cast<button>(g->at(0, 0));
b->clicked_signal = my_callback;

// case 2

button b = cast<button>( w->find_by_name("my_button") );
b->clicked_signal = my_callback;

// case 3

button b = cast<button>( w->find_by_path("my_grid/my_button") );
b->clicked_signal = my_callback;

// case 4

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


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