Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Linux: Composite not complete after shell.open()
Linux: Composite not complete after shell.open() [message #712654] Sun, 07 August 2011 14:54
Eclipse UserFriend
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 ();
}
}
Previous Topic:OS X: tables with alternating background color
Next Topic:Apply button working in real time
Goto Forum:
  


Current Time: Sun Nov 23 16:02:27 GMT 2014

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

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