Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Problem about composite size
Problem about composite size [message #463576] Wed, 09 November 2005 15:52 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:Display browser component to a new shell
Next Topic:How to make check/radio button larger?
Goto Forum:
  


Current Time: Sat Apr 27 00:01:48 GMT 2024

Powered by FUDForum. Page generated in 0.03041 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top