From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,STOX_REPLY_TYPE, STOX_REPLY_TYPE_WITHOUT_QUOTES,WEIRD_PORT,XPRIO autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!nzpost2.xs4all.net!news.kpn.nl!not-for-mail From: "ldries46" Newsgroups: comp.lang.ada Subject: GtkAda. Printing Date: Wed, 3 Aug 2016 09:02:58 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 16.4.3528.331 X-MimeOLE: Produced By Microsoft MimeOLE V16.4.3528.331 Message-ID: <57a1973c$0$12033$e4fe514c@news.kpn.nl> NNTP-Posting-Host: 77.168.179.107 X-Trace: 1470207804 dreader34.news.xs4all.nl 12033 77.168.179.107:64893 X-Complaints-To: abuse@kpn.nl Xref: news.eternal-september.org comp.lang.ada:31262 Date: 2016-08-03T09:02:58+02:00 List-Id: 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