|
Boost : |
From: Russell Hind (rhind_at_[hidden])
Date: 2004-03-04 10:18:49
Jesse Booher wrote:
>>>>dave_at_[hidden] 03/04/04 08:59AM >>>
>
> Well said. This exemplifies the reason why most gui toolkits are so horrible to use, they allow implementation technicalities to dictate interface. Having to decide where an object is going to live before any of its properties can be set is a clear violation of object oriented design principles but we live with these kind of problems all the time for supposed technical reasons.
>
Borland's VCL doens't limit you like this.
TForm* F = new TForm(0);
TButton* B = new TButton(0); (// 0 = null owner)
B->Caption = "Click Me"; // should be B->SetCaption(..) in c++
B->OnClick = BClickHandler; // (this uses __closure extension)
B->Parent = F;
...
TForm* F2 = new TForm(0);
B->Parent = F2;
...
delete B; // removes it from the form it is on
You can move components about which I like the freedom to do. And they
certainly don't need a parent to have their properties set.
Thanks
Russell
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk