Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2004-03-04 09:37:49


"David Turner" <dkturner_at_[hidden]> wrote in message
news:30067.165.165.239.17.1078392630.squirrel_at_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


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