[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [albireo-dev] SWT size/layout management

Gordon Hirsch wrote:
> The controlResized() method is called as part of the setBounds() 
> implementation, which means it can be (indirectly) triggered by a call 
> to layout(). controlResized() is also called as a result of a 
> user-initiated resize.

Thanks, that answers it. It's the event that denotes that the SWT control
has been resized (or is being resized).

Whereas in our case, we want an event that denotes that when computeSize()
will be called the next time, it will return a different result than

This is a different kind of notification; calling it 'controlResized'
will probably lead to confusion. I'll think of another name... maybe

> I can imagine layout() being called from a ControlListener if it is 
> necessary for an application to synchronize the sizes of multiple 
> widgets under its control, or if a composite widget needs to synchronize 
> the sizes of its child widgets.

Yes, and when a ControlListener calls layout(), it needs to take care
not to go into an infinite recursion. In our case, such infinite recursion
is not possible: 'controlShouldBeResized' can invoke 'layout' which will
invoke 'setBounds'.