From: "ldries46" <bertus.dries@planet.nl>
Subject: GtkAda. Printing
Date: Wed, 3 Aug 2016 09:02:58 +0200
Date: 2016-08-03T09:02:58+02:00 [thread overview]
Message-ID: <57a1973c$0$12033$e4fe514c@news.kpn.nl> (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
next reply other threads:[~2016-08-03 7:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-03 7:02 ldries46 [this message]
2016-08-03 7:39 ` GtkAda. Printing 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
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox