Go to the first, previous, next, last section, table of contents.


Extension Classes Initialization

Extension classes must be able to initialize themselves. To make this easy the core classes provide some special initializing functions for extension classes. Extension classes should only use these, they must not use the normal Python initialization funktion __init__.

When extending a core class by subclassing it together with a number of extension classes, the core class should be the first base class. The extension classes may have to be ordered among themselves too.

When an extended core class is initialized it will traverse the class inheritance tree. When an extension initialization function is found it is called without any arguments except for the object itself. As soon as an extension initialization function is found in a base class, its base classes will not be traversed.

WindowManager provides two extension initialization functions:

__wm_screen_init__
Called after the display is opened, but before any screens are added.
__wm_init__
Called after all the screens have been added, i.e. as the very last thing during the initialization of the window manager.

Screen also provides two extension initialization functions:

__screen_client_init__
Called after the root window has been fetched and the EventDispatcher has been created, but before any clients are added.
__screen_init__
Called after all the clients have been added, i.e. before the window manager adds the next screen.

Client provides only one extension initialization function:

__client_init__
Called after the client has finished all of its core initialization, i.e. just before the screen will add the next client.

There are also corresponding finalization methods:

__wm_del__
__screen_del__
__client_del__
These are called just before the object will finish itself off, similar to the __del__ method of objects. (Actually, these methods are called from the __del__ method of the object.)


Go to the first, previous, next, last section, table of contents.