This document describes the customisation mechanisms for version 4.1/4.4 of the jstools application suite.
(Preferences are stored in files under your ~/.tk directory (the directory .tk under your home directory). Global preferences are stored in the file ~/.tk/defaults. Applicationspecific defaults for each application are stored in the file ~/.tk/app-defaults, where app is the name of the application. You shouldn't need to edit these files by hand.)
In order to write applicationspecific startup scripts effectively, you'll need to know Tcl and Tk, and you may need to know something about the structure of the application. The book Tcl and the Tk Toolkit by the author of Tcl, John Ousterhout, (New York: AddisonWesley, 1994) is a good introduction to programming in Tcl, although you'll also need to refer to the manual pages. You may also find that you can pick up enough by examining the jstools scripts themselves.
In addition, the
jstools applications will read in the startup script
~/.tk/jstoolsrc.tcl on startup if it exists. This isn't likely to be useful
to most people, since you can only put things there that will
work in any application. However, you might be able to use
this file to tie your application to a debugger, or set defaults
differently (with Tk's
option(n) command) depending on what kind of machine you were on or
what time of day it was.
The
jstools applications also support a specialpurpose startup scripts
~/.tk/textbindings.tcl and
~/.tk/entrybindings.tcl. These are intended to supplement the keyboard bindings used
by the applications, so you can make minor changes to them.
Unfortunately, I haven't written documentation about how to do
this yet. (You can include ordinary Tcl
bind commands, but that may break things like
jedit's special interpretation of punctuation and the
Return key, or other special features of the bindings libraries.
I hope to document this in a future version.)
On startup, all jstools applications read in X defaults from the file ~/.tk/jstools.ad. Defaults in that file (which is in normal X resources format, for which see the manual page for X(1X11) or Xserver(1X11)) will override other X defaults you may have set through the normal X defaults mechanism. After that, defaults are read in from the file ~/.tk/app.ad, where app is the name of the application; these defaults override defaults in ~/.tk/jstools.ad.
(At some time in the future, I hope to provide a graphical interface for editing the defaults in these files.)
For reference, here are the defaults I use for Tk widgets:
! defaults for Tk widgets:
!
Tk*Text*font: -*-lucidatypewriter-medium-r-normal-*-*-100-*
Tk*Listbox*font: -*-lucidatypewriter-medium-r-normal-*-*-100-*
Tk*Entry*font: -*-lucidatypewriter-medium-r-normal-*-*-100-*
Tk*Button*font: -*-lucida-medium-r-normal-sans-*-100-*
Tk*Checkbutton*font: -*-lucida-medium-r-normal-sans-*-100-*
Tk*Radiobutton*font: -*-lucida-medium-r-normal-sans-*-100-*
Tk*Menu*font: -*-lucida-medium-r-normal-sans-*-100-*
Tk*Menubutton*font: -*-lucida-medium-r-normal-sans-*-100-*
Tk*Label*font: -*-lucida-medium-r-normal-sans-*-100-*
Tk*Message*font: -*-lucida-medium-r-normal-sans-*-100-*
Tk*insertWidth: 1
Tk*background: grey80
Tk*Text*background: grey80
Tk*Entry*background: grey80
Tk*Scale*sliderForeground: grey80
Tk*Scale*activeForeground: grey90
Tk*Scrollbar*background: grey80
Tk*Scrollbar*foreground: grey80
Tk*Scrollbar*activeForeground: grey90
Tk*activeBackground: grey90
Tk*selectBackground: grey60
Tk*selectForeground: black
Tk*disabledForeground: grey50
Tk*selector: black
##############################################################
# metawidget options:
#
option add *Rule.relief sunken widgetDefault
option add *Rule.width 2 widgetDefault
option add *Rule.height 2 widgetDefault
option add *Rule.borderWidth 1 widgetDefault
option add *Filler.relief flat widgetDefault
option add *Filler.width 10 widgetDefault
option add *Filler.height 10 widgetDefault