[gtkada] Print question

bertus.dries at planet.nl bertus.dries at planet.nl
Mon Aug 1 19:53:21 CEST 2016


I am creating a program that makes some kind of drawing with cairo and pango on my screen.
Now I want to print that drawing I thought I could solve that by:

Drawing on the screen:

procedure Draw_Grid(CR : Cairo_Context) is
..
..
..
end Draw_ Grid;

The drawing on the screen works.

Till now I have used:

with Gtk.Print_Context;     use Gtk.Print_Context;
with Gtk.Print_Operation;   use Gtk.Print_Operation;
with Gtkada.Printing;       use Gtkada.Printing;

procedure On_Print (Object : access Gtk_Menu_Item_Record'Class) is
   pragma Unreferenced (Object);
   Print_Op : Gtk_Print_Operation;
   Result   : Gtk_Print_Operation_Result;
begin
   Gtk_New(Print_Op);
   Set_N_Pages(Print_Op, 1);
   On_Draw_Page(Print_Op, Draw_Page);                                                                      Line 182
   Result := Connect_And_Run(Print_Op, Action_Print_Dialog, Main_Window);           Line 183
end On_Print;

procedure Draw_Page(Op : Gtk_Print_Operation_Record; Context : Gtk_Print_Context;
   Page_nr : Gint) is
   Print_CR : Cairo_Context;
begin
   Print_CR := Get_Cairo_Context (Context);
   Draw_Grid(Print_CR);
end Draw_Page;

Now I get the folowing messages:

182:30: no candidate interpretations match the actuals:
182:30: context requires function call, found procedure name
182:30:   ==> in call to "On_Draw_Page" at gtk-print_operation.ads:769
182:30:   ==> in call to "On_Draw_Page" at gtk-print_operation.ads:765
183:33: expected an access type with designated type "Gtkada_Print_Operation_Record'Class" defined at gtkada-printing.ads:102
183:33: found type "Gtk_Print_Operation" defined at gtk-print_operation.ads:99
183:33:   ==> in call to "Connect_And_Run" at gtkada-printing.ads:110

In the line181 The fact that Print_Op is not a Gtk_Print_Operation_Record does not create an error and Draw+Page is in the listings and the description not a function. I have no idea

L. Dries
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/gtkada/attachments/20160801/94380fa6/attachment.html>


More information about the gtkada mailing list