Hi,
I’ve been trying to get the extcairo driver to work with GtkAda. I’ve been
trying to replicate the ext-cairo-test.c example, but I haven’t been yet
succesful, I get a segfault.. Everything works fine with pdfcairo driver though.
I had to expand the Ada binding a bit, since pl_cmd was not available. Added
this to plplot_thin.ads:
procedure pl_cmd(cmd: PLINT; arg : System.Address);
pragma Import(C, pl_cmd, "pl_cmd");
The code I’m trying is very simple:
…
function Convert is new Ada.Unchecked_Conversion (Source =>
Cairo_Context,
Target => System.Address);
…
— init gtkada etc..
…
Cr := Cairo.Create (surface);
Set_Device_Name("extcairo");
pl_cmd( PLESC_DEVINIT,Convert(Cr) );
Put_line("Cr "&System.Address_Image(Convert(Cr)));
Initialize_PLplot;
Simple_Plot(X=>Pt.X, Y1=>Pt.Y, X_Label=>To_String(Pt.X_Label),
Y_Label=>To_String(Pt.Y_Label),Title_Label=>To_String(Pt.Title));
End_PLplot;
..
Simple_Plot segfaults. The address printed looks valid.
I’m developing on OSX, haven’t yet tried on Linux if it makes any difference.
Thoughts?
//Henri
------------------------------------------------------------------------------
_______________________________________________
Plplot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/plplot-devel