
"David Turner" <dkturner@telkomsa.net> wrote in message news:30067.165.165.239.17.1078392630.squirrel@webmail.telkomsa.net...
As I explained in an earlier post to Peter Dimov, there are technical reasons why this isn't possible. Widgets have to be rooted in an owning window, and it's not possible to transfer widgets from one window to another.
ok, if you say so.
Therefore, button has to take an owner-window parameter in its constructor.
There is a precedent for this: look at the W3C DOM.
The syntax I'm currently considering would make it:
window w("Example Window"); w.contain(button(w, "Click me"));
[note: just one little stupid question more :-)] Why can't window::container be like window::contain( const button& b ) { b.set_owner( this ); add(b ); } button::set_owner( window* w ) { owner_->remove( this ); owner_ = w; } ? br Thorsten