Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Reduce spaces between composite
Reduce spaces between composite [message #484751] Wed, 09 September 2009 06:46 Go to next message
Rahul Yadav is currently offline Rahul YadavFriend
Messages: 65
Registered: July 2009
Member
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 13:44 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
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 #484880 is a reply to message #484850] Wed, 09 September 2009 15:19 Go to previous messageGo to next message
Rahul Yadav is currently offline Rahul YadavFriend
Messages: 65
Registered: July 2009
Member
Hey Thanks,that worked !!
one more issue, I have a Composite "A",i am adding composite "B" on "A",
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" ??
Re: Reduce spaces between composite [message #484965 is a reply to message #484880] Thu, 10 September 2009 00:51 Go to previous message
Remy Suen is currently offline Remy SuenFriend
Messages: 462
Registered: July 2009
Senior Member
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
Previous Topic:Snippet234, synchronized table scroll problem on OSx
Next Topic:SWT Mathematical expression editor
Goto Forum:
  


Current Time: Sat Apr 20 02:37:13 GMT 2024

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

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

Back to the top