Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Weird Layout Resizing Issue
Weird Layout Resizing Issue [message #464322] Mon, 21 November 2005 15:26 Go to next message
Jeff Yuan is currently offline Jeff YuanFriend
Messages: 34
Registered: July 2009
Member
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 16:26 Go to previous message
Gail Jakubowski is currently offline Gail JakubowskiFriend
Messages: 36
Registered: July 2009
Member
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: Fri Apr 19 22:01:44 GMT 2024

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

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

Back to the top