Community
Participate
Working Groups
import org.eclipse.swt.SWT; import org.eclipse.swt.dnd.DropTarget; import org.eclipse.swt.dnd.FileTransfer; import org.eclipse.swt.dnd.Transfer; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.ExpandBar; import org.eclipse.swt.widgets.ExpandItem; import org.eclipse.swt.widgets.Shell; public class Snippet223 { public static void main (String [] args) { Display display = new Display (); Shell shell = new Shell (display); shell.setLayout(new FillLayout()); shell.setText("ExpandBar Example"); ExpandBar bar = new ExpandBar (shell, SWT.V_SCROLL); Button b1 = new Button (bar, SWT.PUSH); b1.setText("Button1"); DropTarget dt = new DropTarget(b1, 0); dt.setTransfer(new Transfer[] { FileTransfer.getInstance() }); ExpandItem item0 = new ExpandItem (bar, SWT.NONE); item0.setText("Blah"); item0.setHeight(b1.computeSize(SWT.DEFAULT, SWT.DEFAULT).y); item0.setControl(b1); item0.setExpanded(true); Button b2 = new Button (shell, SWT.PUSH); b2.setText("Button2"); dt = new DropTarget(b2, 0); dt.setTransfer(new Transfer[] { FileTransfer.getInstance() }); shell.setSize(150, 100); shell.open(); while (!shell.isDisposed ()) { if (!display.readAndDispatch ()) { display.sleep (); } } display.dispose(); } } ---------------------------------------------------------------- Check out the following code. Both buttons have a DropTarget, but only the second one reacts to dragging anything above it. (Looks like it's a problem with ExpandBar)
I cannot reproduce the issue on GTK3.22, 4.8 M7, and Fedora 28.