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

This document describes jinit.tcl version 2001.02.10.
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@aq.org
http://www.aq.org/~js/

Copyright
The library is copyright © 1992-2001 by Jay Sekora, but may be freely redistributed under the conditions at the top of the file.
Overview
Procedure
::jstools::jstools_init - common initialisation for jstools applications and libraries
::jstools::jstools_init
Usage
	::jstools::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 NAME and HOME global variables with the user's login name and home directory, if it can find those in the environment.
· 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.
· It reads in the X resource file ~/.tk/jstools.ad, if it exists, allowing the user to override widget defaults for all jstools applications.
· If app was specified, it also tries to load an application­specific language database for presentation of strings used by the application.
· If app was specified, it tries to load an application­specific X resource file named ~/.tk/app.ad which can override the values in ~/.tk/jstools.ad.
· 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.
· It calls ::jstools::site_init app to perform any site-specific configuration (such as providing the names of available printers).  The installer can edit the file jsiteinit.tcl in the jstools package directory to tailor it for the local installation.  As shipped, that file does nothing (and editing it is optional).

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 ::jstools::fs or ::jstools::prompt_tcl needs entry bindings, and an application which uses ::jstools::more might need text bindings.)
· It would be nice if ::jstools::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.
} {{{list:level:1 {27.0 36.0 39.0 41.0}} {jhtml:anchor:anchorname {20.0 21.0}} {jdoc:anchor:anchorname {2.0 3.0 6.0 7.0 9.0 10.0 17.0 18.0 20.0 21.0}} {jdoc:xref:link {3.52 3.59 3.98 3.121 3.180 3.201 8.210 8.231 8.239 8.256 8.260 8.281 19.0 19.23 26.51 26.58 26.101 26.122}} {jdoc:xref:manpage {8.126 8.133}} {richtext:font:roman {3.0 3.4 3.13 3.52 3.59 3.98 3.121 3.184 3.191 3.234 3.241 3.271 3.294 5.24 5.33 6.0 7.21 8.20 8.29 8.102 8.111 8.126 8.133 8.214 8.221 8.243 8.248 8.260 8.281 8.282 11.0 12.0 12.9 13.0 13.22 15.0 16.0 17.0 19.23 19.52 19.59 20.0 22.25 22.26 22.29 23.0 24.0 24.1 24.4 25.0 26.0 26.51 26.58 26.105 26.112 27.10 27.14 27.19 27.23 29.80 29.87 31.34 31.50 31.120 31.127 32.5 32.8 33.5 33.8 33.87 33.99 33.133 33.149 34.104 34.126 34.131 34.154 35.11 35.35 35.165 35.178 35.186 35.193 37.25 37.39 38.0 39.2 39.202 39.209 39.224 39.237 39.241 39.262 39.315 39.330 40.21 40.45 40.74 40.83 41.0}} {richtext:font:italic {22.26 22.29 24.1 24.4 32.5 32.8 33.5 33.8 33.93 33.96}} {richtext:font:bold {3.4 3.13 3.52 3.59 3.184 3.191 3.234 3.241 5.24 5.33 8.20 8.29 8.214 8.221 19.52 19.59 26.51 26.58 26.105 26.112 29.80 29.87 31.34 31.50 31.120 31.127 33.87 33.93 33.96 33.99 33.133 33.149 34.104 34.126 34.131 34.154 35.165 35.178 35.186 35.193 39.202 39.209}} {richtext:font:bolditalic {8.243 8.248 8.260 8.281}} {richtext:font:typewriter {3.98 3.121 3.271 3.294 8.102 8.111 8.126 8.133 12.0 12.9 13.0 13.22 19.0 19.23 22.0 22.25 27.10 27.14 27.19 27.23 35.11 35.35 37.25 37.39 39.224 39.237 39.241 39.262 39.315 39.330 40.21 40.45 40.74 40.83}} {richtext:font:heading0 {1.0 2.0}} {richtext:font:heading1 {2.0 3.0 6.0 7.0 9.0 10.0 17.0 18.0 20.0 21.0 38.0 39.2}} {richtext:font:heading2 {7.0 7.21 8.282 9.0 10.0 11.0 15.0 16.0 18.0 19.0 21.0 22.0 23.0 24.0 25.0 26.0}} {jdoc:anchorname:Introduction {2.0 3.0}} {jdoc:link:jstools.jdoc {3.52 3.59 26.51 26.58}} {jdoc:topic:jstools {3.52 3.59}} {jdoc:anchorname:Usage {6.0 7.0}} {jdoc:manpage:tclvars {8.126 8.133}} {jdoc:link:jslibraries.tcl {8.210 8.231}} {jdoc:link:jslibraries.jdoc#Usage {8.239 8.256}} {{} {8.243 8.256 9.0 16.0 17.0 19.0 20.0 20.11 20.23 22.1 22.30 23.0 25.0 26.0}} {jdoc:link:jslibraries.jdoc {3.180 3.201 8.260 8.281 26.101 26.122}} {jdoc:anchorname:Credits_and_Copyright {9.0 10.0}} {jdoc:anchorname:Overview {17.0 18.0}} {jdoc:anchorname:j:jstools_init {20.0 21.0}} {list:1:ul {27.0 36.0 39.0 41.0}} {jdoc:link:#::jstools::jstools_init {3.98 3.121 19.0 19.23}} {jhtml:anchorname:::jstools::jstools_init {20.0 21.0}} {special:list_item:1 {27.0 27.1 28.0 28.1 29.0 29.1 30.0 30.1 31.0 31.1 32.0 32.1 33.0 33.1 34.0 34.1 35.0 35.1 39.0 39.1 40.0 40.1}}} {{richptr 3.294} {abbrevstart 35.318} {abbrevend 35.318} {insert 35.318} {insert_save 35.318} {anchor 35.318} {current 34.113}}} {{body_alink #ff0000} {body_vlink #000080} {body_link #0000ff} {body_text #000000} {body_bgcolor #ffffff}}