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, the option -onexit can be also given to control what Ktk will save on program termination. This is achieved by a binding to the <Destroy> event on the main window. If -onexit is not used, nothing is saved. The available save modes are;
-onexit parameter | Effect |
(not specified) | Nothing is saved at program termination |
saveposition | The main window's position only is saved. This is `merged' with any existing contents of the rc file. |
saveconfig | Contents of RunConfig is saved |
saveall | Contents of RunConfig and the main window's position is saved |
This page was last updated on 5th March 1999