From: David Turner (dkturner_at_[hidden])
Date: 2004-03-04 02:40:42
> "David Turner" <dkturner_at_[hidden]> wrote in message
>> The only real problem with "why not" is that gui widgets have shallow
> And why is that a problem?
Because it's surprising to the user (I think).
More to the point, there is a very real problem with creating popup
windows. Remember that the window acts as a factory for all other
widgets, including popup (child) windows. If I were to use the "why not"
syntax, I would have to pass in the owner window as the first parameter of
the constructor, as in:
button b(w, "Click here");
Now consider creating a popup window. The natural syntax is:
But now I've invoked the copy constructor of p, which isn't what I wanted.
The way to make it work properly is to force new windows to be
constructed with a title:
window w("Example Window");
window p(w, "Popup Window");
This is probably the "best" approach, but it still leaves some room for
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk