Problem making a view scrollable [message #466189] |
Wed, 04 January 2006 13:51  |
Eclipse User |
|
|
|
Hi,
I am trying to make a view scrollable. But all I get is blank view. It
does not show my widget. It also loses scroll bars when I use setContent()
method of ScrolledComposite. Here is my code:
private ScrolledComposite top1 = null;
private Composite top = null;
private Label lblEngDesgName = null;
private Text txtEngDesgName = null;
public void createPartControl(Composite parent) {
// TODO Auto-generated method stub
top1 = new ScrolledComposite(parent, SWT.BORDER | SWT.H_SCROLL |
SWT.V_SCROLL);
top = new Composite(top1, SWT.NONE);
top1.setContent(top);
GridLayout gdLayout = new GridLayout(4, false);
top.setLayout(gdLayout);
lblEngDesgName = new Label(top, SWT.NONE);
lblEngDesgName.setText("Engine Designation Name:");
lblEngDesgName.setLayoutData(new
GridData(GridData.HORIZONTAL_ALIGN_END));
txtEngDesgName = new Text(top, SWT.SINGLE | SWT.BORDER);
txtEngDesgName.setLayoutData(new
GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL));
}
1. What am I doing Wrong?
|
|
|
Re: Problem making a view scrollable [message #466240 is a reply to message #466189] |
Thu, 05 January 2006 08:12  |
Eclipse User |
|
|
|
Add the following lines after top1 is created (of course, use your own min
settings):
top1.setExpandHorizontal(true);
top1.setMinWidth(100);
top1.setExpandVertical(true);
top1.setMinHeight(50);
"Dhiresh" <dhiruster@gmail.com> wrote in message
news:6dcdfad067f5165e52c6f248f38e64ad$1@www.eclipse.org...
> Hi,
> I am trying to make a view scrollable. But all I get is blank view. It
> does not show my widget. It also loses scroll bars when I use setContent()
> method of ScrolledComposite. Here is my code:
>
> private ScrolledComposite top1 = null;
> private Composite top = null;
> private Label lblEngDesgName = null;
> private Text txtEngDesgName = null;
> public void createPartControl(Composite parent) {
> // TODO Auto-generated method stub
> top1 = new ScrolledComposite(parent, SWT.BORDER | SWT.H_SCROLL |
> SWT.V_SCROLL);
> top = new Composite(top1, SWT.NONE);
> top1.setContent(top);
> GridLayout gdLayout = new GridLayout(4, false);
>
> top.setLayout(gdLayout);
> lblEngDesgName = new Label(top, SWT.NONE);
> lblEngDesgName.setText("Engine Designation Name:");
> lblEngDesgName.setLayoutData(new
> GridData(GridData.HORIZONTAL_ALIGN_END));
> txtEngDesgName = new Text(top, SWT.SINGLE | SWT.BORDER);
> txtEngDesgName.setLayoutData(new
> GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL));
>
> }
>
> 1. What am I doing Wrong?
>
|
|
|
Powered by
FUDForum. Page generated in 0.02870 seconds