Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Problem making a view scrollable
Problem making a view scrollable [message #466189] Wed, 04 January 2006 18:51 Go to next message
Dhiresh Patel  is currently offline Dhiresh Patel Friend
Messages: 86
Registered: July 2009
Member
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 13:12 Go to previous message
Gail Jakubowski is currently offline Gail JakubowskiFriend
Messages: 36
Registered: July 2009
Member
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?
>
Previous Topic:Converting AWT Image to SWT Image on a Mac
Next Topic:Finding name of image of a selected treeItem
Goto Forum:
  


Current Time: Thu Apr 25 08:22:42 GMT 2024

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

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

Back to the top