Re: Does anyone know the exact difference between a SWT Canvas and a SWT
Composite?
I have never used SWT before, but I have a wild guess
after a little Googling.. (I must be bored!)
<http://www.eclipse.org/documentation/html/plugins/org.eclipse.platform.doc.isv/d
oc/reference/api/org/eclipse/swt/widgets/Composite.html#computeSize(int,%20int,%
20boolean)>
Computes the size of a Composite (which seems to be the rough equivalent of
an AWT Container), a container in the AWT calulates its preferred size from
the (combined) sizes of the components within it.
If you have *no* components in it, its preferred size is 0x0.
(and that is how big it ends up in the GUI)
The (org.eclipse.swt.widgets.)Canvas is meant to be drawn to, and
probably has a mechanism to ensure it has a minimum size, whereas
the Composite does not.
HTH

Signature
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
caroarce@gmail.com - 08 Jun 2005 13:41 GMT
Andrew, Thanks for your reply! After I looked a bit more at the source
code I have arrived to almost the same conclusion. I looks like a
Canvas is the equivalent of a Panel in source code, though apparently
eclipse developers encourage you to use Composites, in places where in
Swing you would use a Panel...
Caro