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=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable 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!border1.nntp.ams1.giganews.com!nntp.giganews.com!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!nzpost2.xs4all.net!news.kpn.nl!not-for-mail From: "ldries46" Newsgroups: comp.lang.ada References: <57a1973c$0$12033$e4fe514c@news.kpn.nl> <57a1c6a7$0$12136$e4fe514c@news.kpn.nl> <57a2d3a9$0$20631$e4fe514c@news.kpn.nl> <57a3297e$0$20642$e4fe514c@news.kpn.nl> In-Reply-To: <57a3297e$0$20642$e4fe514c@news.kpn.nl> Subject: Re: GtkAda. Printing Date: Thu, 4 Aug 2016 14:27:31 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="Windows-1252"; reply-type=response Content-Transfer-Encoding: 7bit Importance: Normal X-Newsreader: Microsoft Windows Live Mail 16.4.3528.331 X-MimeOLE: Produced By Microsoft MimeOLE V16.4.3528.331 Message-ID: <57a334d0$0$20655$e4fe514c@news.kpn.nl> NNTP-Posting-Host: 77.168.179.107 X-Trace: 1470313680 dreader33.news.xs4all.nl 20655 77.168.179.107:53482 X-Complaints-To: abuse@kpn.nl Xref: news.eternal-september.org comp.lang.ada:31285 Date: 2016-08-04T14:27:31+02:00 List-Id: After looking at several places I found the following acc LRM (3.10) I must declare a parameter of the cb.... type Draw : Cb_Gtk_Print_Operation_Gtk_Print_Context_Gint_Void := Draw_Page'Access; and changing On_Draw_Page to On_Draw_Page(Print_Op, Draw); Now the error changed to : expected type "Cb_Gtk_Print_Operation_Gtk_Print_Context_Gint_Void" defined at gtk-print_operation.ads:754 : found type access to procedure "Draw_Page" defined at line 184 "ldries46" schreef in bericht news:57a3297e$0$20642$e4fe514c@news.kpn.nl... I tried the various files from the Gtkada examples but they use almost the same methods I do. The only thing I cannot find in these files is how to use On_Draw_Page and that is the point that causes my trouble. When outcommenting the all works correct can see the Print dialog and I even can start the print. This print is empty, because the draw_page event is not connected with the Draw_Page routine. To create that the On_Draw_Page routine is necessary. And that still is creating the troubles. The Call rouine is of the following type : Cb_Gtk_Print_Operation_Gtk_Print_Context_Gint_Void. Describes as type Cb_Gtk_Print_Operation_Gtk_Print_Context_Gint_Void is not null access procedure (Self : access Gtk_Print_Operation_Record'Class; Context : not null access Gtk.Print_Context.Gtk_Print_Context_Record'Class; Page_Nr : Gint); Until now I have tried Draw_Page and Draw_Page'Access L. Dries "Dmitry A. Kazakov" schreef in bericht news:nnup8m$6jg$1@gioia.aioe.org... On 2016-08-04 07:33, ldries46 wrote: > I still cannot find how to address the draw_page routine ib there You must use correct types. That's all. If Draw_Page does not match expected parameters profile wrap it into another subprogram. GtkAda has examples (testgtk). Read the example of printing (create_print.adb). Modify it for your case. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de