Can I get the examples of Java calling X API directly, it would let
me to work on it too
or is it something that you have to extract motif specific java classes
and create one.
Sridhar,
I am suspicious of two possible
things. We may be trashing memory somewhere, or it also makes me
recall a problem that we have related to XInitThreads. In any case,
Grant is right: try his simple example and let us know if that works
or not. If the simple example still hangs, the next step is to try
a pure OS.* test (i.e., no SWT infrastructure, just X API calls from Java)
- we'll send you the example if Grant's thing fails.
|
Grant_Gayed@xxxxxxx
Sent by: platform-swt-dev-admin@xxxxxxxxxxx
02/28/2002 12:09 PM
Please respond to platform-swt-dev |
To: platform-swt-dev@xxxxxxxxxxx
cc:
Subject: Re: [platform-swt-dev]
Running ControlExample example program fails underHP-UX |
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