[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.platform.swt] Re: problems with my composite

computeSize() answers the "ideal" size of the control based on its content.
However this does not apply well for Canvas because its content is painted
later, so 64x64 is a defined default size.  pack() behaves similarly since
it sets the receiver to its "ideal" size.

Grant


"Torsten 'Ilja' Rathgen" <vgap4@xxxxxx> wrote in message
news:ek7733$g0e$1@xxxxxxxxxxxxxxxxxxxx
> Grant Gayed schrieb:
> > ...and I just remembered, after disposing-then-recreating the
composite's
> > children, be sure to invoke layout() on the composite so that it will
> > calculate the appropriate sizes for all of the new children.
>
> Ahh I found the problem. I invoked layout() together with pack(). That
> is wrong with only layout() it works fine ... Thanks.
>
> But another question, why does pack() as well as
> computeSize(SWT.DEFAULT,SWT.DEFAULT) both give a preferred size of 64*64
> of a canvas, which I set the size to 160x120 (because the image i put
> into has this size) ???
>
> cu
> Ilja