elements in a GROUP are not visible [message #181553] |
Fri, 24 November 2006 06:17  |
Eclipse User |
|
|
|
Originally posted by: brahim.zemmit.alcatel.de
hello,
I'm trying to fill the view part of an RCP client example with the
following code, and i don't know why the elements inside the Group are not
visible!
Can anybody help me?
Thank you
//------>
public class View extends ViewPart {
public static final String ID = "app.view";
public void createPartControl(Composite parent) {
RowLayout fl = new RowLayout();
parent.setLayout(fl);
Group frame = new Group(parent, SWT.NONE);
frame.setSize(400,100);
frame.setText("GROUP ");
frame.setToolTipText("Tooltip");
frame.setBackground(new Color(null,0xEE,0xEE,0xEE));
Label label = new Label(frame, SWT.SHADOW_ETCHED_IN);
label.setText("Label");
label.setEnabled(true);
frame.pack();
Text text = new Text(frame, SWT.SHADOW_ETCHED_IN);
text.setLocation(50, 100);
....
//<-----
|
|
|
Re: elements in a GROUP are not visible [message #181711 is a reply to message #181553] |
Fri, 24 November 2006 11:09   |
Eclipse User |
|
|
|
Originally posted by: wegener.cboenospam.com
Brahim Zemmit wrote:
> hello,
>
> I'm trying to fill the view part of an RCP client example with the
> following code, and i don't know why the elements inside the Group are
> not visible!
>
> Can anybody help me?
> Thank you
>
> //------>
> public class View extends ViewPart {
> public static final String ID = "app.view";
>
> public void createPartControl(Composite parent) {
>
> RowLayout fl = new RowLayout();
> parent.setLayout(fl);
> Group frame = new Group(parent, SWT.NONE);
> frame.setSize(400,100);
> frame.setText("GROUP ");
> frame.setToolTipText("Tooltip");
> frame.setBackground(new Color(null,0xEE,0xEE,0xEE));
>
>
> Label label = new Label(frame, SWT.SHADOW_ETCHED_IN);
> label.setText("Label");
> label.setEnabled(true);
> frame.pack();
>
> Text text = new Text(frame, SWT.SHADOW_ETCHED_IN);
> text.setLocation(50, 100);
> ....
>
> //<-----
>
>
I'm not exactly sure, but I think it is discouraged to change the layout
of a your parent composite when creating a ViewPart.
The Group widget is a composite, so it has its own layout. Have you
tried setting the layout on the Group instead of on the parent?
frame.setLayout(fl) instead of parent.setLayout(fl);
|
|
|
|
Powered by
FUDForum. Page generated in 0.10070 seconds