Inicializace

Your library must be initialized before it can be used, to register the new types that it makes available. Also, the C library that you are wrapping might have its own initialization function that you should call. You can do this in an init() function that you can place in hand-coded init.h and init.cc files. This function should initialize your dependencies (such as the C function, and gtkmm) and call your generated wrap_init() function. For instance:

void init()
{
  Gtk::init_gtkmm_internals(); //Sets up the g type system and the Glib::wrap() table.
  wrap_init(); //Tells the Glib::wrap() table about the libsomethingmm classes.
}

Implementace metody wrap_init() ve wrap_init.cc je generovaná skriptem generate_wrap_init.pl, ale deklarace ve wrap_init.h je psaná ručně, takže musíte upravit wrap_init.h, aby se funkce wrap_init() vyskytovala ve správném jmenném prostoru C++.