[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] adding event to a line

I am trying to adding an event to a line so that I can drag a line on composite.

Here is my code.


final Composite composite = new Composite(scomposite, SWT.NONE);
Color backgroundColor = new Color(composite.getDisplay(), 246, 160, 11);
scomposite.setContent(composite);
composite.setLayout(null);
composite.setSize(editorWidth, editorHeight);
composite.setBackground(backgroundColor);
composite.addPaintListener(new PaintListener() {
public void paintControl(PaintEvent e) {
e.gc.drawLine(Constants.LEFT_XCOORDINATE, Constants.LEFT_YCOORDINATE, Constants.HORIZONTAL_WIDTH, 20);
e.gc.drawLine(20, 20, 20, }
});



Is there a way to make a draggable line? I want a user to drag a line on a composite. It would be a great help if anybody tells me an alternative way to do it.

Please help.

Thanks.