Kinit: Library Initialisation
A Tcl/Tk application that is to use K.tk must call the procedure Kinit before creating any widgets. Kinit reads the user's ~/.kderc file and alters the option database to use the currently selected colour scheme and fonts. If the user has no ~/.kderc file (has never used the control panel), Kinit uses a set of built-in defaults for font and colour.
Kinit initialises a cache of pixmap and bitmap files using the contents of the environment variable ICONPATH. If this is not set, it caches the contents of $KDEDIR/share/toolbar.
The option -strict boolean is used to force the library to behave as closely to the KDE standard as possible. When strict behaviour is turned off, some slight relaxation of KDE behaviour is seen. I call these improvements. With the 0.3 release the file select window includes a file remove feature in non-strict mode. Defaults to strict mode.
The option -rcfile name is used to specify the name of a configuration file for the application. If the name starts with a leading slash (/) name is assumed to be the absolute pathname for the file, otherwise name is looked for first in the user's config directory ~/.kde/share/config and then the system config directory $KDEDIR/share/config. If an rcfile is found, the contents are read into the global associative array RunConfig. If an rcfile is specified, Kinit creates a binding for the <Destroy> event on the main window, plus the Window Manager command WM_SAVE_YOURSELF. It uses this to save the contents of the RunConfig array at program exit. The option -saveposition can be used to control what is saved at program exit, according to the following table;
-rcfile | -saveposition | Effect |
not specified | (value ignored) | Nothing is saved at program termination |
specified | (not specified) | Contents of RunConfig and the main window's position are saved |
specified | yes | Contents of RunConfig and the main window's position are saved |
specified | no | Contents of RunConfig are saved, but not the main window's position |
specified | only | Only the the main window's position is saved, preserving any previous contents of the rcfile |
This page was last updated on 15th February 1999