Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Running ControlExample example program failsunderHP-UX

Grant,

It works. But, I dont see the polygon draw. But, dont we
have to use the canvas to draw the polygon rather than
shell.

Thanks
-Sri


Grant_Gayed@xxxxxxx wrote:

> Sridhar,
>
> Can you try the following shorter example and let us know if it hangs:
>
> import org.eclipse.swt.events.*;
> import org.eclipse.swt.graphics.*;
> import org.eclipse.swt.widgets.*;
>
> public class TestFillPolygon {
>       public static void main (String[] args) {
>             final int[] points = new int[] {771,6,771,16,766,11};
>             final Display display = new Display ();
>             Shell shell = new Shell (display);
>             shell.setBounds (10, 10, 800, 90);
>             shell.addPaintListener(new PaintListener () {
>                   public void paintControl (PaintEvent e) {
>                         Color colour = new Color(display,new
> RGB(222,233,244));
>                         e.gc.setBackground(colour);
>                         colour.dispose();
>                         e.gc.fillPolygon(points);
>                   }
>             });
>             shell.open ();
>             while (!shell.isDisposed ()) {
>                   if (!display.readAndDispatch ()) display.sleep ();
>             }
>             display.dispose ();
>       }
> }
>
> Grant
>
> Mike,
>
> Thanks for the response. Yes, the arguments look reasonable enough and I
> have already gone
> thru. listing out the <xy> points, the drawable, display and the GC with
> their respective style
> and mode, which is the default(Complex & CoordModeOrigin). Also, tried with
> the different
> combinations of shape and mode arguments, no change. Created a simple
> example C program,
> which contains the same points as the one in the controlexample program,
> and the XFillPolygon
> works fine. I have attached the controlexample log file where it list out
> the debug info. of the
> JNI code before hanging in XFillPolygon. And also, note that, by replacing
> it with XDrawLines
> draws the lines on the arrow button of the Tab widget and runs the
> controlexample pgm just
> fine.
>
> I will go thru. more thoroughly on the HP documentation for any hints or
> specifics for the above
> problem to occur.
>
> Thanks
> -Sri
>
> _______________________________________________
> platform-swt-dev mailing list
> platform-swt-dev@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/platform-swt-dev



Back to the top