Linux: Composite not complete after shell.open() [message #712654] |
Sun, 07 August 2011 14:54 |
Eclipse User |
|
|
|
Originally posted by: Thomas Barth
Hi,
is this a bug or is this sourcecode wrong? In my application I need a
main composite with layout data "GridData(GridData.FILL_BOTH)". But on a
linux system since Ubuntu 10.04 it s not complete after shell.open() has
been called and when one item exists in a menu. When I resize the shell
with the mouse the composite is complete as expected for
GridData.FILL_BOTH! This problem doesnt exists on a Windows system or on
a Linux system without an menuitem.
public class Snippet {
public static void main (String [] args) {
Display display = new Display ();
Shell shell = new Shell (display);
shell.setLayout(new GridLayout());
shell.setSize(400, 300);
Menu bar = new Menu (shell, SWT.BAR);
shell.setMenuBar (bar);
//An item in the menu causes incomplete compsite
MenuItem item1 = new MenuItem (bar, SWT.CASCADE);
item1.setText ("System");
Composite contentPanel = new Composite (shell, SWT.BORDER);
contentPanel.setLayout(new StackLayout());
contentPanel.setLayoutData(new GridData(GridData.FILL_BOTH));
shell.open ();
while (!shell.isDisposed ()) {
if (!display.readAndDispatch ()) display.sleep ();
}
display.dispose ();
}
}
|
|
|
Powered by
FUDForum. Page generated in 0.40343 seconds