"Zhenyu Zhou" <[email protected]> wrote in message 
news:[email protected]...
>
> e.g.
> Rectangle rect(Rectangle r) {
>  _rect = r;
>  redraw();
>  return _rect;
> }
>
> If you allow
> widget.rect.w = 200;
> widget.rect.h = 100;
> you will have to write much more code to handle the painting correctly.
> and we don't want to call redraw twice here
>

I've dealt with that sort of thing in C# and it's a trivial issue. When you 
write code such as the above, it's very clear that you're changing the rect 
twice. If that's a problem, you just do this:

widget.rect = Rect(200, 100);

Easy. 


Reply via email to