Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [gef-dev] draw2D : Canvas or Composite ?

You are NOT supposed to use the Composite that is passed in on createPartControl(Composite).
You are supposed to use that composite as the *parent* for your Control. So, create a Canvas that is parented by that composite.

"Sreekanth, Manohar" <manohar.sreekanth@xxxxxxx>




          "Sreekanth, Manohar" <manohar.sreekanth@xxxxxxx>
          Sent by: gef-dev-admin@xxxxxxxxxxx

          06/20/2002 12:43 PM
          Please respond to gef-dev



To: "'gef-dev@xxxxxxxxxxx'" <gef-dev@xxxxxxxxxxx>
cc:
Subject: [gef-dev] draw2D : Canvas or Composite ?


Hi,

The documentation for Draw2D states "A draw2d instance consists of an SWT
Composite, a Lightweight System, and its contents: figures..."

Unfortunately, that is not completely correct - it consists of an SWT Canvas
( not Composite ). This is turning out to be a disadvantage for me when I
want to create an Eclipse View that contains a draw2D graphic.

The "org.eclipse.ui.part.ViewPart" class passes a
"org.eclipse.swt.widgets.Composite" object in its method
"createPartControl()" which we need to implement in order to create an
Eclipse View. But this "Composite" object is not useful for me since the
"com.ibm.etools.draw2d.LightweightSystem" constructor expects a "Canvas" and
not a "Composite".

How can I get around this ? ( Creating a new Canvas object using the
Composite does not help ).

Thanks,
Manohar

_______________________________________________
gef-dev mailing list
gef-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/gef-dev

GIF image

GIF image


Back to the top