Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] z order composite text swt 3.2.36C

Code that worked in 3.1 is broken in 3.2.  Text is hidden behind a composite.

I expect the text control to show "on top" of the composite:

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;

public class MyLayout {
   public static void main (String [] args) {
      Display display = new Display ();
      Shell shell = new Shell (display);
      FormLayout formLayout = new FormLayout ();
      shell.setLayout (formLayout);
      
      Composite composite0 = new Composite (shell, SWT.BORDER);
      FormData data = new FormData ();
      composite0.setLayoutData (data);

      // why is this hidden behind the composite?
      Text text2 = new Text (shell, SWT.BORDER);
      text2.setText ("text2");
      FormData data1 = new FormData ();
      data1.right = new FormAttachment (composite0, 10, SWT.RIGHT);
      // data1.left = new FormAttachment (composite0, 10, SWT.RIGHT);
      data1.bottom = new FormAttachment (composite0, 0, SWT.BOTTOM);
      text2.setLayoutData (data1);

      shell.pack ();
      shell.open ();

      while (!shell.isDisposed ()) {
         if (!display.readAndDispatch ())
            display.sleep ();
      }
      display.dispose ();
   }
}
-- 
View this message in context: http://www.nabble.com/z-order-composite-text-swt-3.2.36C-tp17081867p17081867.html
Sent from the Eclipse Platform - swt mailing list archive at Nabble.com.



Back to the top