Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Reduce spaces between composite
Reduce spaces between composite [message #484751] |
Wed, 09 September 2009 02:46  |
Eclipse User |
|
|
|
Hi All,
I have a composite with one column on which i add 3 more composites one
under the other.i see gap between these composite that is much more then
my requirement,can we reduce this gap??
Composite composite = new Composite(parent, SWT.NONE);
composite.setLayout(new GridLayout(1, false));
composite.setBackground(new Color(parent.getDisplay(), 124, 124, 124));
// First Composite
Composite textComposite = new Composite(composite, SWT.FILL
| SWT.SHADOW_OUT);
textComposite.setLayout(new GridLayout(4, false));
textComposite.setLayoutData(new GridData(0, SWT.TOP, false, false));
// Second Composite
Composite scopeComposite = new Composite(composite, 0);
scopeComposite.setLayout(new GridLayout(3, true));
scopeComposite.setLayoutData(new
GridData(GridData.FILL_HORIZONTAL,SWT.TOP, false, false));
// Third Composite
Composite optionComposite = new Composite(composite, 0);
optionComposite.setLayout(new GridLayout(2, true));
optionComposite.setLayoutData(new
GridData(GridData.FILL_HORIZONTAL,SWT.TOP, false, false));
|
|
|
Re: Reduce spaces between composite [message #484850 is a reply to message #484751] |
Wed, 09 September 2009 09:44   |
Eclipse User |
|
|
|
GridLayout has some fields that you can set for spacing. You probably want
something like yourGridLayout.verticalSpacing = 1.
Grant
"Rahul Yadav" <rahulyadav20@gmail.com> wrote in message
news:a4bf6cbe471afc53f12cb2a65557d9cd$1@www.eclipse.org...
> Hi All,
> I have a composite with one column on which i add 3 more composites one
> under the other.i see gap between these composite that is much more then
> my requirement,can we reduce this gap??
>
> Composite composite = new Composite(parent, SWT.NONE);
> composite.setLayout(new GridLayout(1, false));
> composite.setBackground(new Color(parent.getDisplay(), 124, 124, 124));
>
> // First Composite
>
> Composite textComposite = new Composite(composite, SWT.FILL
> | SWT.SHADOW_OUT);
> textComposite.setLayout(new GridLayout(4, false));
> textComposite.setLayoutData(new GridData(0, SWT.TOP, false, false));
>
> // Second Composite
> Composite scopeComposite = new Composite(composite, 0);
> scopeComposite.setLayout(new GridLayout(3, true));
> scopeComposite.setLayoutData(new
> GridData(GridData.FILL_HORIZONTAL,SWT.TOP, false, false));
>
> // Third Composite
> Composite optionComposite = new Composite(composite, 0);
> optionComposite.setLayout(new GridLayout(2, true));
> optionComposite.setLayoutData(new
> GridData(GridData.FILL_HORIZONTAL,SWT.TOP, false, false));
>
>
|
|
| |
Re: Reduce spaces between composite [message #484965 is a reply to message #484880] |
Wed, 09 September 2009 20:51  |
Eclipse User |
|
|
|
On Wed, 09 Sep 2009 15:19:51 +0000, Rahul Yadav wrote:
> i see some gap between the boundries of "A" and "B",is there a way to to
> hide "A" completly with "B" i.e. boundries of "A" collides with
> boundries of "B" ??
Like Grant said earlier, you can resolve this by tweaking the margins of
your 'A' composite's GridLayout. Alternatively, just use a FillLayout.
Remy
|
|
|
Goto Forum:
Current Time: Tue Jul 22 19:29:12 EDT 2025
Powered by FUDForum. Page generated in 0.04373 seconds
|