Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT Layouts..
SWT Layouts.. [message #460362] Wed, 24 August 2005 09:28 Go to next message
Eclipse UserFriend
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 09:37 Go to previous messageGo to next message
Eclipse UserFriend
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 09:44 Go to previous messageGo to next message
Eclipse UserFriend
> 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 09:50 Go to previous messageGo to next message
Eclipse UserFriend
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 10:48 Go to previous message
Eclipse UserFriend
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: Fri Jul 04 15:11:53 EDT 2025

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

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

Back to the top