The jstools Global Preferences panel

Introduction

The jstools package provides a Global Preferences panel, shared by several applications, which lets you specify preferences that are shared among the jstools applications. This panel is available from within the supported jstools applications, and also via the standalone jprefs application, which is just a wrapper around it.

(Most jstools applications also provide application­specific preferences which can be set from within the application with an application­specific preferences panel.)

The Global Preferences panel is implemented by the jprefpanel.tcl library; if you're a Tk programmer, you can use it in your own applications.

This document describes the Global Preferences panel provided by version 4.1/4.4 of the jstools libraries.

Usage

NOTE: Some of these preferences do not take effect until the next time an application is run. (Also, which preferences take effect immediately and which are only effective the next time an application is run may vary from application to application.)

Choosing preference categories

At the top of the Global Preferences panel is a pop-up option button that lets you select among several categories of preferences. When you choose a particular category, the contents of the panel change to let you see and adjust the preferences in that category. For instance, to see or adjust the preferences relating to printing, you would choose `Printing' on the option button at the top of the panel, and then the several printing preferences would be displayed in the centre of the panel.

General preferences

Language

The entry field labelled `Language:' is for a two­letter ISO language code, such as en for English or fr for French, or for such a code followed by some number of additional specifiers, such as en.us for US English, or fr.be for Belgian French, or en.us.boston for Bostonian English. If possible, jstools applications will display buttons, menus, prompts, etc., in the selected language.

Auto­position dialogue boxes

If `Auto­position dialogue boxes' is selected, then applications that use the jstools libraries will attempt to centre dialogue boxes (like the Global Preferences panel itself) on the screen. Otherwise they will let your window manager position them (and your window manager may ask you to choose a position for them).

Confirm actions

If `Confirm actions' is selected, applications will ask for confirmation before certain actions, such as quitting or overwriting an existing file. This is the default, but you will no doubt quickly become annoyed with it. You are welcome to turn it off.

Fast file selector

If `Fast file selector' is selected, the File Selector panel will come up a little faster, but it won't distinguish directories by appending a slash to their names, as it normally does. (This checkbox is duplicated on the File Selector panel itself.)

Strict Motif emulation

If `Strict Motif emulation' is not selected, user­interface components such as buttons and scrollbars will highlight when the mouse pointer is moved over them to indicate they are active. If it is selected, they will not change colour. This preference doesn't take effect until the next time an application is run.

Scrollbar side

If `Scrollbar side' is set to `left', scrollbars will be put to the left of the objects (normally text widgets or listboxes) they control; otherwise they'll be put to the right. This preference doesn't take effect until the next time a window with a scrollbar is created (i.e., windows that are already on the screen won't have their scrollbars moved).

Visible Bell

If `Visible Bell' is selected, jstools applications will simulate a bell by briefly flashing the relevant window.

Audible Bell

If `Audible Bell' is selected, then jstools applications will ring the display's bell when they need to catch your attention.

It's fine for both `Visible Bell' and `Audible Bell' to be selected. It's also OK for neither to be selected; you just won't get any notification when an application tries to ring the bell.

Printing

Printer

The `Printer:' field lets you type in the name of your printer. (It sets the J_PREFS(printer) variable; it's up to the individual application to honour this.)

How to print

The `How to print:' preference lets you select what command to use to print. If you select `lpr', the Berkeley-style lpr command (also compatible with lprNG) will be used to print; this is likely to work on Linux and BSD variants. If you select `lp', the AT&T System V-style lp command will be used; this is likely to work on Solaris. If you select `custom', then you can choose a custom command below to print. (This lets you do pretty much anything.) If you select `file', then instead of being sent to the printer, output will be saved in a file you name below.

Custom print command

The `Custom print command:' field is only used if you select `custom' for `How to print:'. It gives a command which will receive the data to be printed on standard input. Within the command, you can use `$J_PREFS(printer)' to refer to the user's current printer (as set above). This command is used for both PostScript and plain-text printing.

Output file

The `Output file:' field is only used if you select `file' for `How to print:'. It names the file in which the data that otherwise will be printed will be stored. If a relative pathname is used, the file will be created in the applications current working directory.

Keyboard

Keyboard bindings

The three radio buttons in the `Keyboard' section let you select what kind of keyboard bindings you want. `Basic bindings' gives you a very basic interface, which supports the arrow keys, the mouse, the Home, End, Next, and Prior (or PageUp and PageDown) keys if your keyboard has them, and not much else. `Emacs bindings' gives you keyboard bindings modelled after the default keyboard commands of the Emacs editor, including the use of Control-u or Escape+number for repetition. `vi bindings' gives you keyboard bindings modelled after those of the vi editor (at present these are still rudimentary). `EDT bindings' gives you bindings modelled after the VMS EDT editor, for which I am very grateful to Achim Bohnet <ach@rosat.mpe-garching.mpg.de>. (Achim has also done a lot of work on the vi bindings, and the bindings are still very much under development.)

Typing replaces selection

If `Typing replaces selection' is selected, then typing while there's a selection will replace the selection (unless the insert point doesn't touch the selection), and moving the insert point, either by clicking with the mouse or through keyboard commands, will deselect any selected text. With this option selected, the selection works more the way it does on a Mac or in a Motif application; without it, the selection works more the way it does in xterm(1). (You may be more comfortable with this turned on if you're used to word processors, copying text is quicker with it off.)

Helper Apps

Web Browser

The Web Browser preference let you specify which application to use to display Web pages. Currently, it's only used by jdoc.

Man Page Viewer

The Man Page Viewer preference let you specify how to show manual pages. Currently, it's only used by jdoc. I strongly recommend using Tom Phelps' TkMan application to view man pages; it's available from ftp://ftp.cs.berkeley.edu/ucb/people/phelps/tcltk/tkman.tar.Z, and information about it is available under Tom's Web page at http://http.cs.berkeley.edu/~phelps/.

Screen Fonts

The `Screen Fonts' section lets you specify the screen fonts that will be used to display various types of text. Unfortunately, there's not a good user interface to this yet; currently, you just have to type the font name in a fashion that Tk understands. I hope to fix this soon.

PostScript

The `PostScript' section lets you adjust some of the parameters when PostScript is generated from rich text. It lets you choose PostScript fonts to use and adjust some of the font sizes and line spacing.

Saving Preferences (Or Not)

The Save button saves your global preferences to disk, so they will be used the next time you start a jstools application, and closes the Global Preferences panel.

The Done button closes the Global Preferences panel. The current settings will be used by the application, but they won't be saved to disk, so any changes you've made (since you last saved your preferences) won't be reflected the next time you use a jstools application.

Global preferences are saved in the file ~/.tk/defaults.tcl, which is just a series of Tcl set commands that set elements in the global array J_PREFS. Most jstools applications save their application­specific preferences in the same format in the file ~/.tk/application-defaults.tcl, where application is the name of the particular application, but some may save them someplace else and/or in some other format.)

Evolution

Feel free to report bugs (and feature requests) to me, <js@aq.org>, and I will try to deal with them. Also, feel free to fix bugs or add features on your own and let me know how you did it.