KDE Now! Logo

Kinit: Library Initialisation

Usage:
Kinit ?-strict boolean? ?-rcfile name ?-onexit saveposition|saveconfig|saveall??

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
Applications may like to invoke SaveRunConfig to save the application's current configuration. The procedure is called with two parameters; the name of the rcfile to save to and the appropriate value for the ``onexit'' flag, i.e. saveposition, saveconfig or saveall. It is also permitted to supply the value nothing to indicate nothing to be saved. See kexample for further details.
Ktk is maintained by Andrew F. Lack

This page was last updated on 5th March 1999