Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] Using a LayoutData several times

I've noticed that it is not possible to reuse an instance of a LayoutData for more than one SWT control. For instance see the following lines of code:
 
  GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
  gridData.horizontalSpan = 2;
 
  Button b1 = new Button(group1, SWT.CHECK);
  whole.setText("Checkbox 1");
  whole.setLayoutData(gridData);
 
//  gridData = new GridData(GridData.FILL_HORIZONTAL);
//  gridData.horizontalSpan = 2;
 
  Button b2 = new Button(searchGroup, SWT.CHECK);
  match.setText("Checkbox 2 - 2 - 2 - 2 - 2 - 2 - 2 - 2");
 
When two lines are commented out, the gridData is not applied to b2, and so the long text is not shown (will overflow) in the Group group1.
 
I've seen that there is nothing more that a checkWidget() and a local assignment for setLayoutData(), so why is it not possible to apply a single instance to multiple widgets?
 
 
I also don't understand what is the difference between SYSTEM_MODAL and APPLICATION_MODAL.
 
Thanks in advance.
 

Back to the top