comp.lang.ada
 help / color / mirror / Atom feed
From: "ldries46" <bertus.dries@planet.nl>
Subject: Re: GtkAda. Printing
Date: Wed, 3 Aug 2016 12:25:17 +0200
Date: 2016-08-03T12:25:17+02:00	[thread overview]
Message-ID: <57a1c6a7$0$12136$e4fe514c@news.kpn.nl> (raw)
In-Reply-To: <nns747$s6g$1@gioia.aioe.org>

Yes Print is declared as Gtkada_Print_Operation; and still in the Call to 
routine Set_N_Pages(Print_Op, 1); the compiler does not find an error while 
the declaration is

procedure Set_N_Pages
   (Self    : not null access Gtk_Print_Operation_Record;
    N_Pages : Gint);

and

type Gtkada_Print_Operation_Record is new
  Gtk_Print_Operation_Record with private;
type Gtkada_Print_Operation is access all Gtkada_Print_Operation_Record;

I expect that in the compiler to react the same in simular cases. Therefore 
I think that the error in lines 190:30 is the real error and the one I asked 
about.

"Dmitry A. Kazakov"  schreef in bericht news:nns747$s6g$1@gioia.aioe.org...

On 2016-08-03 09:02, ldries46 wrote:

> 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

The compiler told you everything you need. You use an instance of
Gtkada_Print_Operation instead of access Gtk_Print_Operation_Record.

The types are declared as follows:

type Gtkada_Print_Operation_Record is
    new Gtk_Print_Operation_Record with private;
type Gtkada_Print_Operation is access all Gtkada_Print_Operation_Record;

P.S. Granted, it seems a glitch in the GtkAda bindings which should have
used access Gtk_Print_Operation_Record'Class instead. But nothing you
could not workaround with an explicit type conversion...

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de 

  reply	other threads:[~2016-08-03 10:25 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 [this message]
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