[gtkada] gtk-entry_completion.adb

Emmanuel Briot briot at adacore.com
Thu May 31 17:44:13 CEST 2012


> But if Set_Model has a null Model then Constraint_Error is raised.
> In the past I found the same problem in Gtk.Tree_View, which was then changed to:

In the version of GtkAda you have, the file gtk-entry_completion.ads was 
generated automatically from what the gtk+ team calls a GIR file.
I seem to remember that the script that processes that file was not taking into 
account the allow-none property, so indeed the generated binding does not 
support passing null.

All active GtkAda development now goes on a branch to support gtk3. In this 
branch, the automatic binding for Set_Model properly accepts passing null as a 
parameter, so the problem will be solved when we finally move officially to that 
branch.

In the meantime, your suggest binding is fine indeed. Thanks for the report

Emmanuel

> So this implementation should I think be changed in the same way:
>
>     procedure Set_Model
>       (Completion : access Gtk_Entry_Completion_Record;
>        Model      : Gtk_Tree_Model)
>     is
>        procedure Internal
>          (Completion : System.Address;
>           Model      : System.Address);
>        pragma Import (C, Internal, "gtk_entry_completion_set_model");
>     begin
>        Internal (Get_Object (Completion), Get_Object (Model));
>     end Set_Model;


More information about the gtkada mailing list