I'm trying SWT for the first time, and I can't figure out how to use a Menu bar along with any space-filling layout. The Composite's layout is calculated without taking the Menu into account, so that once the Menu is added the bottom of the layout gets clipped.

Amazingly, when the user resizes, the Menu is taken into account and the layout is fine. But I can't figure out how to fix it programmatically; `shell.layout(true,true)`, `shell.setSize(250,250)`, `shell.pack()` don't fix the problem.

![Menu causes layout to clip.](https://i.stack.imgur.com/zDDC4.png)![After resize, everything is fine.](https://i.stack.imgur.com/Ilp8j.png)

```
package com.appspot.htmldoodads.pdfstuffs;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.widgets.Shell;

public class MenuLayout {
    public static void main(String[] argv) {
        final Display display = new Display();
        final Shell shell = new Shell(display);

        GridLayout shellLayout = new GridLayout();
        shell.setLayout(shellLayout);

        // Add a menu bar with File -> Open...
        Menu bar = new Menu(shell, SWT.BAR);
        shell.setMenuBar(bar);
        MenuItem fileItem = new MenuItem(bar, SWT.CASCADE);
        fileItem.setText("&File");
        Menu subMenu = new Menu(shell, SWT.DROP_DOWN);
        fileItem.setMenu(subMenu);
        MenuItem openItem = new MenuItem(subMenu, SWT.CASCADE);
        openItem.setText("&Open...");

        // Add a button that fills the space.
        Button big = new Button(shell, SWT.PUSH);
        big.setText("Fill.");
        GridData bigLayoutData = new GridData(GridData.FILL, GridData.FILL, true, true);
        big.setLayoutData(bigLayoutData);

        // Add a button that doesn't fill space.
        new Button(shell, SWT.PUSH).setText("Regular");

        shell.layout(true, true);
        shell.setSize(250,250);
        shell.open();
        while ( ! shell.isDisposed ()) {
            if (!display.readAndDispatch())
                display.sleep();
        }
        display.dispose();
    }
}

```