Project: SWT
Bug 270880 Combo does not fire SWT.Modify immediately on select(int)
Reported: 2009-04-01 16:59:00 | Status: resolved fixed

The following snippet prints an event on Win32 (and probably other platforms) but not on Cocoa: package snip; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Shell; public class SnipComboModify { public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new GridLayout(1, false)); Combo combo = new Combo(shell, SWT.DROP_DOWN); combo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); combo.setItems(new String[] { "one", "two", "three" }); combo.addListener(SWT.Modify, new Listener(){ public void handleEvent(Event event) { System.out.println("received: " + event.type); } }); combo.select(1); display.dispose(); } } This is causing a failure in the data binding test suite.

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTComboBoxCell.java bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Combo.java bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Widget.java