3.2. The static part of a module

A module must have a static part to be able to get loaded just like a text module. Now, let's see the differences. The graphical module depends on the "lttvwindow" module. See module.c from the control flow viewer for an example.

The init() and destroy() functions must register functions that can be called by user interaction to instanciate the viewers. That's the goal of lttvwindow_register_constructor() and lttvwindow_unregister_constructor() : they register a function with a menu entry and an icon. The main window will shown them in its interface and call the function when the button or menu item is selected. This hook function must receive a pointer to a "Tab" object in parameter.

Also note the presence of the destroy_walk() method. It is called when the module is unloaded : it must destroy all the instances of the viewers from the module.