comp.lang.ada
 help / color / mirror / Atom feed
* GtkAda. Printing
@ 2016-08-03  7:02 ldries46
  2016-08-03  7:39 ` Dmitry A. Kazakov
  0 siblings, 1 reply; 9+ messages in thread
From: ldries46 @ 2016-08-03  7:02 UTC (permalink / raw)


I have a good working procedure procedure Draw_Grid(CR : Cairo_Context); 
which draws the contents of a Drawing Area.

Now I want that drawing on my printer. The examples I can find on internet 
all result in problems. In one g_signal_connect is called used together with 
G_CALLBACK But I have no idea which package they belong to. In another, 
using Gtkada.printing they use On_Draw_Page for connecting the draw_page 
event with a handler routine. In that case I use

On_Draw_Page(Print_Op, Draw_Page); here Draw_Page is the name of a routine 
that overwrites the value of the routine in the package.

My version is:

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

But in building the compiler gives an error on Draw_Page with the messages 
for On_Draw_Page

190:07: missing argument for parameter "Slot" in call to "On_Draw_Page" 
declared at gtk-print_operation.ads:769
190:20: expected an access type with designated type 
"Gtk_Print_Operation_Record" defined at gtk-print_operation.ads:98
190:20: found type "Gtkada_Print_Operation" defined at 
gtkada-printing.ads:104
190:20:   ==> in call to "On_Draw_Page" at gtk-print_operation.ads:765
190:30: no candidate interpretations match the actuals:
190:30: context requires function call, found procedure name
190:30:   ==> in call to inherited operation "On_Draw_Page" at 
gtkada-printing.ads:102

With Draw_Page relaced by Draw_Page'Access it gives the same errors.

The error on 190.07 and 190.20 look like the result of the one in 190.30 
because
there are two instances op On_Draw_Page one with two and one with three 
parameters, I use the one with two and in other procedures and functions I 
can without an error set a value of type Gtk_Print_Operation at a location 
that expect Gtk_Print_Operation_Record.

What is the correct way to present the handler routine in On_Draw_Page, 
because that is my preference.

L. Dries


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-08-05 17:34 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-03  7:02 GtkAda. Printing ldries46
2016-08-03  7:39 ` Dmitry A. Kazakov
2016-08-03 10:25   ` ldries46
2016-08-03 10:55     ` Dmitry A. Kazakov
2016-08-04  5:33       ` ldries46
2016-08-04  7:01         ` Dmitry A. Kazakov
2016-08-04 11:39           ` ldries46
2016-08-04 12:27             ` ldries46
2016-08-05 17:34               ` ldries46

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox