package snippets; import org.eclipse.swt.SWT; import org.eclipse.swt.events.KeyEvent; import org.eclipse.swt.events.KeyListener; import org.eclipse.swt.events.MouseEvent; import org.eclipse.swt.events.MouseListener; import org.eclipse.swt.graphics.Point; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.CoolBar; import org.eclipse.swt.widgets.CoolItem; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; /** * Copyright Wynne Crisman 2006
*/
public class Bindings {
/**
* Bindings constructor.
*/
public Bindings() {
super();
}
/**
* @param args
*/
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
CoolBar bar = new CoolBar(shell, SWT.BORDER);
for(int i=0; i<2; i++) {
CoolItem item = new CoolItem (bar, SWT.DROP_DOWN);
Button button = new Button (bar, SWT.PUSH);
button.setText ("Button " + i);
Point size = button.computeSize (SWT.DEFAULT, SWT.DEFAULT);
item.setPreferredSize (item.computeSize (size.x, size.y));
item.setControl (button);
}
bar.pack();
shell.open();
/*