[gtkada] Passing context objects to handlers via Register_Handler

Emmanuel Briot briot at adacore.com
Thu Jan 12 08:01:38 CET 2017


> I *believe* that this isn't working as I would like because
> Gtkada_Builder_Record isn't a tagged type. From my understanding,
> procedure/function signatures using Gtkada_Builder_Record'Class would gladly
> accept my extended (and tagged) record, if the "parent" were to be tagged.

It is a tagged type, since it extends a tagged type.

>    arun.adb:56:16: expected type "Gtkada_Builder" defined at gtkada-builder.ads:84
>    arun.adb:56:16: found type "Arun_Builder" defined at line 40
>    gprbuild: *** compilation phase failed


Gtk_New specifically expected a Arun_Builder, so you can’t give it another type.
Instead:


    Builder := new Arun_Builder_Record;
    Gtkada.Builder.Initialize (Builder);

should do the trick.

regards
Emmanuel



More information about the gtkada mailing list