FigureCanvas Bounds [message #186113] |
Fri, 01 July 2005 15:32  |
Eclipse User |
|
|
|
Is FigureCanvas doing something that a normal SWT Canvas is not in
relation to it's bounds? If I run the following snippet there is a
margin around the FigureCanvas that doesn't allow for me to put 2
FigureCanvases next to each other sharing a border, there's always a gap.
Display display = new Display();
Shell shell = new Shell(display);
StackLayout layout = new StackLayout();
shell.setLayout(layout);
Composite composite = new Composite(shell, SWT.NONE);
GridLayout gridLayout = new GridLayout();
gridLayout.horizontalSpacing = 0;
gridLayout.verticalSpacing = 0;
composite.setLayout(gridLayout);
FigureCanvas canvas = new FigureCanvas(composite);
canvas.setLayoutData(new GridData(GridData.FILL_BOTH));
canvas.setBackground(display.getSystemColor(SWT.COLOR_RED));
canvas = new FigureCanvas(composite);
canvas.setLayoutData(new GridData(GridData.FILL_BOTH));
canvas.setBackground(display.getSystemColor(SWT.COLOR_RED));
layout.topControl = composite;
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
If I change this from being FigureCanvas and use just a Canvas the two
widgets are right up against each other without any spacing.
I'm running Eclipse 3.1 and GEF 3.1RC4.
Thanks,
Brad
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04783 seconds