Project: SWT
Bug 103719 SWT.CENTER causes composite to not be displayed
Reported: 2005-07-13 17:23:35 | Status: closed wontfix

I am using the code snippet below to create a button bar in a dialog. Composite buttonBar = new Composite(parent, SWT.CENTER); GridLayout layout = new GridLayout(); layout.numColumns = 0; layout.makeColumnsEqualWidth = true; buttonBar.setLayout(layout); GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_CENTER); buttonBar.setLayoutData(gd); Button agreeButton = createButton(buttonBar, LicenseAcceptanceDialog.OK, CachePlugin.getResourceString(_UI_CACHE_DIALOG_AGREE_BUTTON), false); Button disagreeButton = createButton(buttonBar, LicenseAcceptanceDialog.CANCEL, CachePlugin.getResourceString(_UI_CACHE_DIALOG_DISAGREE_BUTTON), false); return buttonBar; On Windows this displays two buttons in the dialog, on linux the buttons are not displayed. Changing the first line Composite buttonBar = new Composite(parent, SWT.CENTER); to Composite buttonBar = new Composite(parent, SWT.NONE); displays properly on both platforms. This inconsistent behaviour makes it very difficult to diagnose problems. I'm using Eclipse 3.1, RedHat Enterprise Linux WS r3.

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java