[gtkada] simple.adb (again)

Joel Brobecker brobecker at act-europe.fr
Wed Jan 3 09:13:12 CET 2001


> > Remember that callback packages must be instantiated at library
> > level, so in this example, you'll have to create a separate package
> > (simple is just a procedure).
> 
> What does it means to instantiate at library level? Why do I need a
> separate package? What is wrong with the following version of
> simple.adb?

This is documented in the GtkAda Users Guide:
<< WARNING: all the generic packages allocate some memory for internal
structures, and call internal functions. This memory is freed by gtk
itself, by calling some Ada functions. Therefore the generic packages
have to be instanciated at library level, not inside a subprogram, so
that the functions are still defined when gtk needs to free the memory
>>

In this very simple case, I suspect that it will work because the
Handlers package will always be defined. However, this is a specific
case which we did not want to detail, to avoid unnecessary confusion.

-- 
Joel




More information about the gtkada mailing list