Skip to main content



      Home
Home » Newcomers » Newcomers » elements in a GROUP are not visible
elements in a GROUP are not visible [message #181553] Fri, 24 November 2006 06:17 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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);
Re: elements in a GROUP are not visible [message #181788 is a reply to message #181711] Mon, 27 November 2006 07:25 Go to previous message
Eclipse UserFriend
Originally posted by: brahim.zemmit.alcatel.de

Thank you David,

setting the layout on the Group instead of on the parent works fine!
Previous Topic:how do I get early access to 64-bit versions?
Next Topic:Can the system editor be changed?
Goto Forum:
  


Current Time: Tue Jul 22 15:29:04 EDT 2025

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

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

Back to the top