This document describes version 4.1/4.4 of the jstools libraries.
To use the libraries that have not yet been converted over to the package mechanism, you simply need to ensure that they (and the tclIndex file that lists them) are in your global Tcl auto_path variable, and you can call them.
To use the libraries that have been packagized, you again need to make sure that the directory containing them and the pkgIndex.tcl file that lists them is in your auto_path variable, and then you can use `package require jstools' to arrange for them to be loaded as needed.
Many of the jstools libraries also use the jldb package (distributed along with them), and I'm not sure they all properly require it. So you probably should also `package require jldb'.
If this sounds complicated, don't worry. Assuming you used
the
jinstall.tcl script to install the
jstools package, you can simply use the code listed below under
Usage at the top of your script to make the libraries available.
The only thing you should need to change is the line
set jstools_library /usr/lib/jstools
replacing
/usr/lib/jstools with whatever directory you told
jinstall.tcl to put the libraries into.
###################################################################### ## begin boiler_header if {[info exists env(JSTOOLS_LIB)]} { set jstools_library $env(JSTOOLS_LIB) set jstools_pkg [file join $env(JSTOOLS_LIB) pkg] } else { set jstools_library /usr/lib/jstools set jstools_pkg [file join $jstools_library pkg] } # add the jstools library to the library search path: set auto_path [concat [list $jstools_pkg] [list $jstools_library] $auto_path ] # check for ~/.tk and prepend it to the auto_path if it exists. # that way the user can override and customise the jstools libraries. if {[file isdirectory ~/.tk]} then { set auto_path [concat [list [glob ~/.tk]] $auto_path] } ## end boiler_header # the import IS A BIG PROBLEM until this whole file gets wrapped in its own # namespace: catch { package require jldb # following likely to fail, because done by other libraries too namespace import ::jldb::shortcuts::* } catch { package require jstools namespace eval ::jstools { } ;# so namespace is defined } ######################################################################You should also call ::jstools::jstools_init early in your code; this reads in global (crossapplication) preferences, which are used by some of the other libraries, and automatically sets up bindings for entry and text widgets based on the user's preferences.
jldb.tcl - localisation support for naturallanguage strings
jdebug.tcl - debugging support
jfileio.tcl - convenience procedures for reading from and writing to files
jinit.tcl - the common
jstools initialisation sequence
jparseargs.tcl - procedures for parsing procedure and application arguments
jprefixmatch.tcl - filename expansion and abbreviation matching procedures
jhistory.tcl - procedures to use persistent (ondisk) history lists
jprefs.tcl - general routines for loading, saving, and using preferences
(see also
jprefpanel.tcl)
jstools.tcl - miscellaneous procedures shared by
jstools applications
[documentation missing]
jtkutils.tcl - convenience procedures and userinterface layout support
jtclutils.tcl - convenience procedures that don't require Tk
jtkversion.tcl - procedures for writing code compatible with both Tk 3 and
Tk 4
jviewers.tcl - show manual pages or URLs with the user's preferred tools
jmetawidgets.tcl - compound widgets including a colour chooser
joptionbutton.tcl - a button that lets the user choose one of several options
jtext.tcl - wrappers around the text widget's widget command
jtextcmds.tcl - uservisible command procedures for working with text
jabout.tcl - richtext about panels
(see also
jrichtext.tcl)
jalert.tcl - popup notification panels
jconfirm.tcl - a panel asking the user to confirm actions
jfindpanel.tcl - a searchandreplace panel for the text widget
jfs.tcl - a fileselector panel
jmore.tcl - a textdisplay panel
jprefpanel.tcl - a preference panel for setting shared
jstools preferences
jprompts.tcl - procedures to ask the user for various kinds of information
jcommand.tcl - procedures to manage user-invokable commands
jmenu.tcl - procedures to manage menus
(see also
jprompts.tcl,
jinit.tcl, and
jtextcmds.tcl)
jrichtext.tcl - procedures to embed rich text in Tk applications
jtagconvert.tcl - procedures for saving multifont text in various formats
jtexttags.tcl - extensive support for working with tagged text
(see also
jtext.tcl and
jtextcmds.tcl)
Currently, only jbindentry.tcl, jbindtext.tcl, jcompose.tcl, and jlatin1.tcl are documented at all, and they aren't documented very thoroughly. However, the others are not intended to be called directly; they're called by the libraries mentioned above.
jbindentry.tcl - several userselected styles of entry bindings
jbindtext.tcl - several userselected styles of text bindings
(see also
jtext.tcl)
jcompose.tcl - support for the
Compose key
jentrybasic.tcl - support for minimalist bindings
jentryedt.tcl - rudimentary support for EDT bindings
jentryemacs.tcl - support for Emacsstyle entry bindings
jentrykeys.tcl - general support for entry keyboard bindings
jentrymouse.tcl - support for entry mouse bindings
jentryvi.tcl - support for vistyle entry bindings
jlatin1.tcl - additional support for the
Compose key
jtextbasic.tcl - support for minimalist text bindings
jtextedt.tcl - rudimentary support for EDT bindings
jtextemacs.tcl - support for Emacsstyle text bindings
jtextkeys.tcl - support for text keyboard bindings
jtextmouse.tcl - support for text mouse bindings
jtextvi.tcl - support for vistyle text bindings
In many places in the libraries, I've borrowed code from other people (with permission); they're mentioned in the documentation files for the individual libraries and in comments in the code itself.