Grid Layout [message #52032] |
Wed, 25 March 2009 12:00  |
Eclipse User |
|
|
|
Hi,
I'm implementing an Wizard Page extending the class WizardPage. In the
createControl method I have the following code:
public void createControl(Composite parent) {
Composite composite1 = createComposite(parent,2);
new Label(composite1,SWT.NULL).setText("class name:");
className = createTextField(composite1);
className.addModifyListener(new TextModifyListener());
textChanged();
Composite composite2 = createComposite(parent,1);
composite2.setVisible(true);
new EiffelContainerSelectionGroup(composite2,null);
setControl(parent);
}
the problem is: the second composite is not showing up inside the Wizard
Page - only the first one.
the createComposite method looks as follows:
private Composite createComposite(Composite parent, int columns){
Composite composite = new Composite(parent,SWT.NULL);
GridLayout layout = new GridLayout();
layout.numColumns = columns;
composite.setLayout(layout);
GridData data = new GridData();
data.horizontalAlignment=SWT.FILL;
data.grabExcessHorizontalSpace=true;
//data.verticalAlignment=SWT.FILL;
composite.setLayoutData(data);
return composite;
}
Does anyone know, where the problem is? I've tried to put the two
composites inside a top-level composite and with that both composites
appeared but the result didn't look like I expected it to do. Although I
specified only one column for the top Level composite, all widgets were on
the left side of the page...
Kind regards, Kathi
|
|
|
|
|
|
|
Re: Grid Layout [message #53170 is a reply to message #52136] |
Thu, 02 April 2009 04:31  |
Eclipse User |
|
|
|
Prakash G.R. wrote:
> shouldn't you call setControl() with *your* top level composite and not with
> the parent that is passed to you?
> - Prakash
Yes, that was the initial problem: I have to create only one control and
pass it to the parent. Evertything else should be inside this new top
level control.
thanks for your help
Kathi
|
|
|
Re: Grid Layout [message #593975 is a reply to message #52032] |
Wed, 25 March 2009 12:11  |
Eclipse User |
|
|
|
it's me again,
I tried to modify the GridData a bit and now it works with the extra
top-Level Composite.
But it shouldn't it work without this extra composite, too?
regards, Kathi
|
|
|
Re: Grid Layout [message #593984 is a reply to message #52060] |
Thu, 26 March 2009 01:34  |
Eclipse User |
|
|
|
Katharina Brandl wrote:
> it's me again,
>
> I tried to modify the GridData a bit and now it works with the extra
> top-Level Composite.
> But it shouldn't it work without this extra composite, too?
>
> regards, Kathi
>
You problem has more chances of getting resolved at SWT newsgroup eclipse.platform.swt
Am not SWT guru, but it looks like you were facing this issue either due to incorrect spanning (hspan) or incorrect nesting of composites. Like I said - i don't know for sure.
Ankur..
|
|
|
|
|
Re: Grid Layout [message #594471 is a reply to message #52136] |
Thu, 02 April 2009 04:31  |
Eclipse User |
|
|
|
Prakash G.R. wrote:
> shouldn't you call setControl() with *your* top level composite and not with
> the parent that is passed to you?
> - Prakash
Yes, that was the initial problem: I have to create only one control and
pass it to the parent. Evertything else should be inside this new top
level control.
thanks for your help
Kathi
|
|
|
Powered by
FUDForum. Page generated in 0.05474 seconds