Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT Layouts..
SWT Layouts.. [message #460362] Wed, 24 August 2005 13:28 Go to next message
Matt is currently offline MattFriend
Messages: 19
Registered: July 2009
Junior Member
Hi,

I'm trying to fill a screen with a composite, then at somepoint this composite gets hidden, and a new one is created which also needs to fill the screen.. eventually this is disposed and the original composite is called back with setVisible(true).

Now, before I used layout managers within these composites I was simply using setSize( screen width, height) to fill the screen with them. But this seems to no longer work (just a white screen appears).

So I decided to try using fill layout on the shell; which works for the first screen, but no matter what I do (create new filllayout/call layout() etc.) I can't get the second to appear.. (once again it will just turn into a white screen).

Argh, help? :)

Coding this for a pocketpc, first time using SWT.
Re: SWT Layouts.. [message #460369 is a reply to message #460362] Wed, 24 August 2005 13:37 Go to previous messageGo to next message
Olivier Chalouhi is currently offline Olivier ChalouhiFriend
Messages: 10
Registered: July 2009
Junior Member
Matt,

The StackLayout is what your need.
Make sure you call shell.layout() after changing the topControl value of
the layout.

Regards,

Olivier.

Matt wrote:
> Hi,
>
> I'm trying to fill a screen with a composite, then at somepoint this composite gets hidden, and a new one is created which also needs to fill the screen.. eventually this is disposed and the original composite is called back with setVisible(true).
>
> Now, before I used layout managers within these composites I was simply using setSize( screen width, height) to fill the screen with them. But this seems to no longer work (just a white screen appears).
>
> So I decided to try using fill layout on the shell; which works for the first screen, but no matter what I do (create new filllayout/call layout() etc.) I can't get the second to appear.. (once again it will just turn into a white screen).
>
> Argh, help? :)
>
> Coding this for a pocketpc, first time using SWT.
Re: SWT Layouts.. [message #460382 is a reply to message #460362] Wed, 24 August 2005 13:44 Go to previous messageGo to next message
Ricky is currently offline RickyFriend
Messages: 204
Registered: July 2009
Senior Member
> I'm trying to fill a screen with a composite, then at somepoint this
> composite gets hidden, and a new one is created which also needs to fill
> the screen.. eventually this is disposed and the original composite is
> called back with setVisible(true).

Sounds like the right time to use StackLayout. Only one control at a time
is visible in this layout.

this.stackComposite = new Composite(parent,SWT.NONE);

this.stackLayout = new StackLayout();
this.stackComposite.setLayout(this.stackLayout);

Control nextTopControl = new ...

this.stackLayout.topControl = nextTopControl;
this.stackCanvas.layout();

hth,

Ricky
Re: SWT Layouts.. [message #460388 is a reply to message #460382] Wed, 24 August 2005 13:50 Go to previous messageGo to next message
Matt is currently offline MattFriend
Messages: 19
Registered: July 2009
Junior Member
I thought that.. but there is no stack layout..

Perharps it's because it's a SWT implementation for WinCE?
Re: SWT Layouts.. Ok.. argh? [message #460398 is a reply to message #460362] Wed, 24 August 2005 14:48 Go to previous message
Matt is currently offline MattFriend
Messages: 19
Registered: July 2009
Junior Member
Right.. so I've managed to get it working with FillLayout..

The second composite is there if I set items using setBounds.. but as soon as I try to use a layout on it (e.g. gridlayout).. nothing will appear..
(I know the layout code is correct as it's the same code being used on the first composite!)..

argh?! :(
Previous Topic:Question regarding new Dispose Strategy in SWT 3.2
Next Topic:Testing
Goto Forum:
  


Current Time: Thu Apr 15 02:57:58 GMT 2021

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

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

Back to the top