Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Weird Layout Resizing Issue
Weird Layout Resizing Issue [message #464322] Mon, 21 November 2005 10:26 Go to next message
Eclipse UserFriend
Hi,
One question about layout. I'm using a Gridlayout to layout a few widgets
and weird things happen. The program starts at some size, and when you
resize it to be smaller, everything is fine, but when you try to resize it
and make it bigger, the components do not get bigger to fill the bigger
shell (components stay the same size and a big margin appears).

I'm using a gridlayout with one column (GridLayout(1, false)), and inside
of it I have a toolbar and a horizontal SashForm. That's it. Anyone know
what I'm doing wrong or how to fix it? I tried setting various properties
but it doesn't work very well.

Thanks.
Re: Weird Layout Resizing Issue [message #464331 is a reply to message #464322] Mon, 21 November 2005 11:26 Go to previous message
Eclipse UserFriend
The composite and the components need to be told to fill the extra space.
This should work:

composite.setLayout(new GridLayout(1, false));
//set the composite to expand horizontal and vertical
composite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true,
true));

//set the toolbar to expand horizontal
myToolbar.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true,
false));

//set the sashform to expand horizontal and vertical
mySashForm.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true,
true));


"zinc" <zincsterio@yahoo.com> wrote in message
news:9379e43408ecf914676708f9fdd46527$1@www.eclipse.org...
> Hi,
> One question about layout. I'm using a Gridlayout to layout a few widgets
> and weird things happen. The program starts at some size, and when you
> resize it to be smaller, everything is fine, but when you try to resize it
> and make it bigger, the components do not get bigger to fill the bigger
> shell (components stay the same size and a big margin appears).
>
> I'm using a gridlayout with one column (GridLayout(1, false)), and inside
> of it I have a toolbar and a horizontal SashForm. That's it. Anyone know
> what I'm doing wrong or how to fix it? I tried setting various properties
> but it doesn't work very well.
>
> Thanks.
>
Previous Topic:Is there Any way to disable the ability of an eclipse view to be resized?
Next Topic:Failure in ByteArrayTransfer nativeToJava()
Goto Forum:
  


Current Time: Mon Jul 07 06:00:20 EDT 2025

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

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

Back to the top