[gtkada] Ada interfaces vs. GLib interfaces

Dmitry A. Kazakov mailbox at dmitry-kazakov.de
Mon Jul 1 21:10:31 CEST 2013


On Mon, 1 Jul 2013 20:45:16 +0200, you wrote:

> That of course mean that you need to duplicate all the inherited subprograms,
> since you can't have bodies for primitives of interfaces.

Yes, because Ada has neither MI nor delegation.

If you want bodies you could make operations class-wide:

function Get_Iter_First
   (Model : not null access Gtk_Tree_Model_Record'Cass) 
      return Gtk_Tree_Iter;

Leaving To_Interface single primitive operation. The implementation of
Get_Iter_First will dispatch to To_Interface and then pass the result to C.

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


More information about the gtkada mailing list