comp.lang.ada
 help / color / mirror / Atom feed
From: "ldries46" <bertus.dries@planet.nl>
Subject: Re: GtkAda. Printing
Date: Thu, 4 Aug 2016 14:27:31 +0200
Date: 2016-08-04T14:27:31+02:00	[thread overview]
Message-ID: <57a334d0$0$20655$e4fe514c@news.kpn.nl> (raw)
In-Reply-To: <57a3297e$0$20642$e4fe514c@news.kpn.nl>

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 


  reply	other threads:[~2016-08-04 12:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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