Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Canvas overlaying Shell
Canvas overlaying Shell [message #780937] Fri, 20 January 2012 04:04
Paul Morris is currently offline Paul MorrisFriend
Messages: 8
Registered: December 2011
Junior Member
Is it possible to position a canvas to overlay the shell wherein it takes up the whole space that the shell does? I've tried looking into layouts and trying to force the canvas to overlay the shell by using setLocation and setBounds but I think I'm working against the API here. I'm doing this:

getWindowConfigurer().setShellStyle(SWT.NO_TRIM | SWT.ON_TOP | SWT.NO_BACKGROUND);


then this:

Toolkit toolkit = Toolkit.getDefaultToolkit();
Dimension dim = toolkit.getScreenSize();
Shell shell = getWindowConfigurer().getWindow().getShell();
shell.setBounds(new Rectangle(0, 0, (int)dim.getWidth(), (int)dim.getHeight()));
shell.setAlpha(20);


and then this (with parent being a reference to the shell):

FillLayout fill = new FillLayout();
parent.setLayout(fill);
final Canvas paintCanvas = new Canvas(parent, SWT.NO_REDRAW_RESIZE | SWT.NONE);
paintCanvas.setLocation(0, 0);
paintCanvas.setBounds(parent.getBounds());
Previous Topic:Simple Example of Drawing Rectangle with Mouse
Next Topic:Add WindowBuilder TabItem at Runtime
Goto Forum:
  


Current Time: Fri Apr 26 09:07:59 GMT 2024

Powered by FUDForum. Page generated in 0.02905 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top