{jinit.tcl

Introduction
The jinit.tcl library is distributed as part of the jstools package.  It consists of a procedure, j:jstools_init, that reads user preferences and initialises data used by the jstools libraries.  Any application that uses the jstools libraries should either call j:jstools_init early on, or duplicate its functionality.

This document describes jinit.tcl version 4.0/4.0.

Usage
Accessing the Library
In order to use the jinit.tcl library, it (and any other libraries it depends on) must be in your Tcl auto_path, described in tclvars(n).  Information about how to arrange that, and other conventions common to the jstools libraries, is in the Usage section of The jstools Libraries.

Credits and Copyright
Author
Jay Sekora 
js@calumet.org
http://shore.net/~js/

Copyright
The library is copyright © 1992-1995 by Jay Sekora, but may be freely redistributed under the conditions at the top of the file.

Overview
Procedure
j:jstools_init - common initialisation for jstools applications and libraries

j:jstools_init
Usage
	j:jstools_init [app]
Argument
	app - name of the current application

Description
This procedure performs common setup tasks for the jstools applications and other applications using the jstools libraries.  Specifically, it does the following:

* It sets the Tk colormodel to colour if possible (even on displays with only a few colours).  The Tk default is to use monochrome if the display supports sixteen colours or fewer, but many displays with as few as four colours have no trouble displaying Tk's 3­D effects, so the jstools applications use colour if possible.

* It sets NAME and HOME global variables with the values of the corresponding environment variables.

* It sets the application's `client' and `command' properties for the use of X session managers.

* It reads in the user's global preferences.  This is important, as many of the jstools libraries depend on the existence of variables created during this process.

* It tries to load the user's preferred language database for presentation of strings by library routines.

* If app was specified, it also tries to load an application­specific language database for presentation of strings used by the application.

* It sets up Text and Entry bindings to use the user's preferred editor emulation, and reads the user's ~/.tk/textbindings.tcl and ~/.tk/entrybindings.tcl, if any.

If you don't want to use j:jstools_init because there's something it does that you don't like, you should refer to the procedure itself to see what you need to do to initialise your application.

Bugs and Limitations
* Some applications may not use text widgets, entry widgets, or both.  Initialising text and entry mappings is a waste of time and I/O in that case.  (On the other hand, any application which uses such jstools procedures as j:fs or j:prompt_tcl needs entry bindings, and an application which uses j:more might need text bindings.)

* While colour works well for displays with small numbers of shades of grey, it may not work well for all displays with small numbers of actual distinct hues.  Ideally, whether to use colour or monochrome would be decided based on the kind of display (e.g. StaticGray vs. DirectColor) as well as on the number of colours, or perhaps it would be a user preference.

* It would be nice if j:jstools_init could handle setting up the auto_path variable to find the libraries.  Since it is itself called using the auto­loading mechanism, of course, it can't.
} {{{display:foreground:Red {10.282 11.0}} {jdoc:xref:link {4.52 4.59 4.98 4.112 4.171 4.192 10.210 10.231 10.239 10.256 10.260 10.281 23.0 23.14 32.51 32.58 32.101 32.122}} {jdoc:xref:manpage {10.126 10.133}} {jdoc:anchor:anchorname {3.0 4.0 8.0 9.0 12.0 13.0 21.0 22.0 25.0 26.0}} {richtext:font:roman {2.0 3.0 4.0 4.4 4.13 4.52 4.59 4.98 4.112 4.175 4.182 4.225 4.232 4.262 4.276 6.24 6.33 8.0 9.21 10.20 10.29 10.102 10.111 10.126 10.133 10.214 10.221 10.243 10.248 10.260 10.281 10.282 11.0 12.0 14.0 15.0 15.14 16.0 16.21 18.0 19.0 21.0 23.14 23.43 23.50 25.0 27.16 27.17 27.20 28.0 29.0 29.1 29.4 30.0 32.0 32.51 32.58 32.105 32.112 34.279 34.286 36.10 36.14 36.19 36.23 40.80 40.87 44.5 44.8 46.104 46.126 46.131 46.154 48.25 48.39 50.0 51.0 51.202 51.209 51.224 51.228 51.232 51.244 51.297 51.303 53.153 53.157 53.268 53.271 55.21 55.36 55.65 55.74 56.0}} {richtext:font:italic {27.17 27.20 29.1 29.4 44.5 44.8 53.153 53.157 53.268 53.271}} {richtext:font:bold {4.4 4.13 4.52 4.59 4.175 4.182 4.225 4.232 6.24 6.33 10.20 10.29 10.214 10.221 23.43 23.50 30.0 31.0 32.51 32.58 32.105 32.112 34.279 34.286 40.80 40.87 46.104 46.126 46.131 46.154 51.202 51.209}} {richtext:font:bolditalic {10.243 10.248 10.260 10.281}} {richtext:font:typewriter {4.98 4.112 4.262 4.276 10.102 10.111 10.126 10.133 15.0 15.14 16.0 16.21 23.0 23.14 27.0 27.16 36.10 36.14 36.19 36.23 48.25 48.39 51.224 51.228 51.232 51.244 51.297 51.303 55.21 55.36 55.65 55.74}} {richtext:font:heading0 {1.0 2.0}} {richtext:font:heading1 {3.0 4.0 8.0 9.0 12.0 13.0 21.0 22.0 25.0 26.0 50.0 51.0}} {richtext:font:heading2 {9.0 9.21 10.282 11.0 13.0 14.0 18.0 19.0 22.0 23.0 26.0 27.0 28.0 29.0 31.0 32.0}} {jdoc:anchorname:Introduction {3.0 4.0}} {jdoc:link:jstools.jdoc {4.52 4.59 32.51 32.58}} {jdoc:topic:jstools {4.52 4.59}} {jdoc:anchorname:Usage {8.0 9.0}} {jdoc:manpage:tclvars {10.126 10.133}} {jdoc:link:jslibraries.tcl {10.210 10.231}} {jdoc:link:jslibraries.jdoc#Usage {10.239 10.256}} {{} {10.243 10.256 12.0 19.0 20.0 23.0 24.0 25.2 25.14 27.1 27.21 28.0 30.0 32.0 49.0 50.0}} {jdoc:link:jslibraries.jdoc {4.171 4.192 10.260 10.281 32.101 32.122}} {jdoc:anchorname:Credits_and_Copyright {12.0 13.0}} {jdoc:anchorname:Overview {21.0 22.0}} {jdoc:link:#j:jstools_init {4.98 4.112 23.0 23.14}} {jdoc:anchorname:j:jstools_init {25.0 26.0}}} {{abbrevstart 44.38} {richptr 4.276} {abbrevend 44.45} {insert 1.0} {anchor 1.0} {current 1.0}}}