Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Stacklayout
Stacklayout [message #458137] Sun, 10 July 2005 11:06 Go to next message
Eclipse UserFriend
Originally posted by: reinecke.uni-koblenz.de

Hi,

I'm using a stacklayout to change between different composites. The =

composite I have as the topControl first spreads out the way I want it t=
o =

but as soon as I call an underlying composite with setFocus() it is a =

little bit smaller so the first topControl shows through on the sides. =

This is although each composite has the same gridData.

Anyone know what the problem is?

Thanks.
Kath
Re: Stacklayout [message #458138 is a reply to message #458137] Sun, 10 July 2005 12:18 Go to previous messageGo to next message
Max Rotvel is currently offline Max RotvelFriend
Messages: 21
Registered: July 2009
Junior Member
On Sun, 10 Jul 2005 13:06:00 +0200, Kath Reinecke
<reinecke@uni-koblenz.de> wrote:

> I'm using a stacklayout to change between different composites. The
> composite I have as the topControl first spreads out the way I want it
> to but as soon as I call an underlying composite with setFocus() it is a
> little bit smaller so the first topControl shows through on the sides.

You remember to call layout on the parent Composite after you set the new
topControl? Eg:

public void handleEvent(Event event)
{
stackLayout.topControl = yourComposite;
parentComposite.layout();
}

> This is although each composite has the same gridData.

Are you re-using GridData objects? From the GridData Javadoc:

NOTE: Do not reuse GridData objects. Every control in a Composite that is
managed by a GridLayout must have a unique GridData object. If the layout
data for a control in a GridLayout is null at layout time, a unique
GridData object is created for it.

> Anyone know what the problem is?

That's all I could think of.

Regards
--
Max - rotvel AT bolignet-aarhus DOT dk
Re: Stacklayout [message #458140 is a reply to message #458138] Sun, 10 July 2005 14:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: reinecke.uni-koblenz.de

> You remember to call layout on the parent Composite after you set the =
=

> new topControl?

Yes, did that...

>> This is although each composite has the same gridData.
>
> Are you re-using GridData objects?

Ah, no, wrong formulation: each composite has its own GridData object bu=
t =

with the same definitions (so it should look the same).

> That's all I could think of.

Thanks alot anyway!
But just to make sure: Has anyone programmed a wizard or whatever with a=
=

stacklayout where it actually worked? That is, where the composites wher=
e =

the same size on top of each other? I'm starting to think that it might =
=

not be possible...

Kath
Re: Stacklayout [message #458141 is a reply to message #458140] Sun, 10 July 2005 15:29 Go to previous message
Max Rotvel is currently offline Max RotvelFriend
Messages: 21
Registered: July 2009
Junior Member
On Sun, 10 Jul 2005 16:43:26 +0200, Kath Reinecke
<reinecke@uni-koblenz.de> wrote:

> Ah, no, wrong formulation: each composite has its own GridData object
> but with the same definitions (so it should look the same).
>
> Thanks alot anyway!
> But just to make sure: Has anyone programmed a wizard or whatever with a
> stacklayout where it actually worked? That is, where the composites
> where the same size on top of each other? I'm starting to think that it
> might not be possible...

I've tried switching between a few Tree controls when user presses a
button and it just worked, but that's probably a lot simpler than what
you're trying to do.

Try setting the grabExcess*Space fields in your GridData objects and see
what happens :-). Also, it may help debugging your problem by calling
computeSize() on the Composites (and the parent) at various stages and
comparing the results.
--
Max - rotvel AT bolignet-aarhus DOT dk
Previous Topic:WHere is jFace
Next Topic:Translating Win calls to GTK calls
Goto Forum:
  


Current Time: Thu Apr 25 08:42:16 GMT 2024

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

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

Back to the top