Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Propagating Layouts throughout classes
Propagating Layouts throughout classes [message #436792] Mon, 24 May 2004 14:24 Go to next message
Eclipse UserFriend
Originally posted by: bertram.herzog.web.de

Hello together!
I have a question / problem bugging me for some time now: When defining a
Layout Manager in the shell, e.g. FormLayout, and defining, let's say, the
interiour of a Group with a different layout manager, e.g.
RowLayout(SWT.VERTICAL), for every line to be added.

Lines to be added inside this Group are generated by a second class in a
second file, RowCreator (extending Composite), which has a RowLayout()
itself to nicely group the items in every line with different widths.

The crux comes when stepping back from the "RowCreator"-Class to the
first class. RowCreator() does not seem able to hand back the Layout.
Every one of the "lines" generated by the class gets a
RowLayout(SWT.VERTICAL), as defined in the calling class. (
There exists one "this.pack()" at the end of the RowCreator(), and one
"shell.pack()"; no more "pack()"s at the end of a group, etc.)

Do I have a general misunderstanding on how Layout-Managers work, or did I
just miss to hand something over.

Any help is greatly appreciated!
Thanks for your thoughts
Bertram
Re: Propagating Layouts throughout classes [message #436806 is a reply to message #436792] Mon, 24 May 2004 21:10 Go to previous messageGo to next message
Daniel Spiewak is currently offline Daniel SpiewakFriend
Messages: 263
Registered: July 2009
Senior Member
I'm not even sure I understand the question. However, I do know that
you cannot use the same instance of a layout manager on two different
composites. This doesn't work because the fields in the layout manager
are set for one composite, and then the other composite calls the
layout(Composite, boolean) method and everything gets messed up. Your
problem might be in that you (at least from my understanding of the
explanation) are sharing layout managers among multiple composites.

Daniel

Bertram Herzog wrote:

>Hello together!
>I have a question / problem bugging me for some time now: When defining a
>Layout Manager in the shell, e.g. FormLayout, and defining, let's say, the
>interiour of a Group with a different layout manager, e.g.
>RowLayout(SWT.VERTICAL), for every line to be added.
>
>Lines to be added inside this Group are generated by a second class in a
>second file, RowCreator (extending Composite), which has a RowLayout()
>itself to nicely group the items in every line with different widths.
>
>The crux comes when stepping back from the "RowCreator"-Class to the
>first class. RowCreator() does not seem able to hand back the Layout.
>Every one of the "lines" generated by the class gets a
>RowLayout(SWT.VERTICAL), as defined in the calling class. (
>There exists one "this.pack()" at the end of the RowCreator(), and one
>"shell.pack()"; no more "pack()"s at the end of a group, etc.)
>
>Do I have a general misunderstanding on how Layout-Managers work, or did I
>just miss to hand something over.
>
>Any help is greatly appreciated!
>Thanks for your thoughts
> Bertram
>
>
>
Re: Propagating Layouts throughout classes [message #437065 is a reply to message #436792] Fri, 28 May 2004 12:21 Go to previous message
Eclipse UserFriend
Originally posted by: bertram.herzog.web.de

The problem was solved by itself when defining the right parent for the
right layout-manager... ;-( My fault, but thanks for the replies, which
led me to a deeper inspection!


Cheers, Bertram

Bertram Herzog wrote:

> Hello together!
> I have a question / problem bugging me for some time now: When defining a
> Layout Manager in the shell, e.g. FormLayout, and defining, let's say, the
> interiour of a Group with a different layout manager, e.g.
> RowLayout(SWT.VERTICAL), for every line to be added.
>
> Lines to be added inside this Group are generated by a second class in a
> second file, RowCreator (extending Composite), which has a RowLayout()
> itself to nicely group the items in every line with different widths.
>
> The crux comes when stepping back from the "RowCreator"-Class to the
> first class. RowCreator() does not seem able to hand back the Layout.
> Every one of the "lines" generated by the class gets a
> RowLayout(SWT.VERTICAL), as defined in the calling class. (
> There exists one "this.pack()" at the end of the RowCreator(), and one
> "shell.pack()"; no more "pack()"s at the end of a group, etc.)
>
> Do I have a general misunderstanding on how Layout-Managers work, or did I
> just miss to hand something over.
>
> Any help is greatly appreciated!
> Thanks for your thoughts
> Bertram
>
Previous Topic:Change constructor options of widget during runtime
Next Topic:Mouse Wheel
Goto Forum:
  


Current Time: Fri Apr 19 00:06:28 GMT 2024

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

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

Back to the top