[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: Graphics Context doesn't work!

Thx for the fast replies:-)

You were right Jerome, I've used the wrong GC Object. Thanks for your help

Johannes



Jerome Gout wrote:
Hello,

If your goal is to draw something (a line) in a Composite added to a page of an editor or anywhere else you need to add a PaintListener to your composite:

..
composite.addPaintListener(new PaintListener() {

  public void paintControl(PaintEvent event) (
     GC gc = event.gc;
     gc.drawLine(0,0,200,200);
  )
  });

The GC to use is the one provided by the PaintEvent instance.

Hope this helps you
Jerome