Problem about composite size [message #463576] |
Wed, 09 November 2005 15:52 |
Eclipse User |
|
|
|
Originally posted by: yoshmatsumoto.hotmail.com
Hi,
I develop some plugins for Eclipse, and have a problem about SWT.
One of some Composites I develop doesn't show properly until the parent
window is resized.
Once the parent window is resized, the composite( have problem ) will appear
correctly.
If I debug, the size of it remains 0 before the parent window is resized.
How can I resolve this problem ?
Of cource, in the initialization method, setting the width and height
explicitly will resolve,
but I'd like to use layout like FormLayout, and can't compute correct width
and height.
I'm sorry for poor explanation.
|
|
|
Re: Problem about composite size [message #463577 is a reply to message #463576] |
Wed, 09 November 2005 16:32 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
One important thing to get it to work correctly when working with any
layout other than no layout is to not set the size of the shell until
AFTER all of the children have been added correctly.
If you set the size of the shell before adding the children, it won't
cause the children to be re-layedout correctly.
Yoshihisa Matsumoto wrote:
> Hi,
> I develop some plugins for Eclipse, and have a problem about SWT.
> One of some Composites I develop doesn't show properly until the parent
> window is resized.
> Once the parent window is resized, the composite( have problem ) will
> appear correctly.
> If I debug, the size of it remains 0 before the parent window is resized.
> How can I resolve this problem ?
> Of cource, in the initialization method, setting the width and height
> explicitly will resolve,
> but I'd like to use layout like FormLayout, and can't compute correct
> width and height.
>
> I'm sorry for poor explanation.
--
Thanks,
Rich Kulp
|
|
|
Re: Problem about composite size [message #463584 is a reply to message #463576] |
Wed, 09 November 2005 19:59 |
Veronika Irvine Messages: 1272 Registered: July 2009 |
Senior Member |
|
|
After you have created the Composite, all of its children and set up the
layout information you should request taht teh composite be laid out:
problemComposite.getShell().layout(new Control[]{problemComposite});
A free layout request happens when you resize the shell and when a shell is
first opened (if you have not already called shell.setSize() or
shell.setBounds()). Otherwise, you need to request a layout when you have
changed something that will affect the size and position of the widgets.
"Yoshihisa Matsumoto" <yoshmatsumoto@hotmail.com> wrote in message
news:dkt5vk$mkg$1@news.eclipse.org...
> Hi,
> I develop some plugins for Eclipse, and have a problem about SWT.
> One of some Composites I develop doesn't show properly until the parent
> window is resized.
> Once the parent window is resized, the composite( have problem ) will
> appear correctly.
> If I debug, the size of it remains 0 before the parent window is resized.
> How can I resolve this problem ?
> Of cource, in the initialization method, setting the width and height
> explicitly will resolve,
> but I'd like to use layout like FormLayout, and can't compute correct
> width and height.
>
> I'm sorry for poor explanation.
|
|
|
Re: Problem about composite size [message #463598 is a reply to message #463584] |
Thu, 10 November 2005 14:23 |
Eclipse User |
|
|
|
Originally posted by: yoshmatsumoto.hotmail.com
Hi Veronika, Rich,
Thank you very much for your help.
Due to your advice, I've got resolved.
I've learned that we should force re-layout when we dynamically change the
composition of Composites.
I really appreciate for your help.
thanks,
Yoshihisa Matsumoto
|
|
|
Powered by
FUDForum. Page generated in 0.03041 seconds