[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] [GridData] Buttons Placement Problem


i'm using SWT from eclipse API and i'm trying to do some easy GUI but
without success. A pic of what I do can be seen here :


and my code is the following :

import org.eclipse.swt.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.custom.*;
import org.eclipse.swt.layout.*;

public class TestSWT {

public static void main (String [] args) {
 Display display = new Display ();
 Shell shell = new Shell (display);

 GridLayout gridLayout = new GridLayout();
         gridLayout.numColumns = 3;

 Button butt1 = new Button(shell, SWT.PUSH);
 Button butt2 = new Button(shell, SWT.PUSH);
 Button butt3 = new Button(shell, SWT.PUSH);
 Button butt4 = new Button(shell, SWT.PUSH);

 GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
       gridData.widthHint = 40;
       gridData.grabExcessHorizontalSpace = false;

 gridData = new GridData(GridData.FILL_HORIZONTAL);
       gridData.horizontalSpan = 2;

 gridData = new GridData(GridData.FILL_HORIZONTAL);
       gridData.verticalAlignment = gridData.FILL_VERTICAL;
       gridData.horizontalSpan = 2;

 gridData = new GridData(GridData.FILL_VERTICAL);
       gridData.widthHint = 40;
       gridData.grabExcessHorizontalSpace = true;

 shell.pack ();
 shell.open ();
 while (!shell.isDisposed ()) {
  if (!display.readAndDispatch ()) display.sleep ();
 display.dispose ();

The problem is the following :
I want both arrowed button (shown in the picture) with fixed size and button next to its that
take the rest of the window (when you resize it horizontaly).

Thanks in advance for your help.
Any help, even a good place to find prescious help ;)

MSN Search, le moteur de recherche qui pense comme vous ! http://search.msn.fr/worldwide.asp