# 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 applicationspecific preferences which can be set from within the application with an applicationspecific 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.0/4.0b 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.)

### Language

The entry field labelled `Language:' is for a twoletter 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.

### General Behaviour

If `Autoposition 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).

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.

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.)

### Appearance

If `Strict Motif Emulation' is not selected, userinterface 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.

If `Scrollbars on left' is selected, 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).

### The Bell

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

If `Audible Bell' is selected, then under Tk 4 jstools applications will ring the display's bell if possible. (Under Tk 3.6 and earlier, it's not possible to ring the bell, so this selection will have no effect.) Note, however, that neither jstools applications nor the jstools libraries are guaranteed (or even particularly expected) to run under Tk 4.

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.

### Keyboard Bindings

The next three radio buttons 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.)

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.)

### 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/`.

### Printing

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.)

### 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, which is in the standard X Windows resource format. (For more information on this format, see `X`(1), particularly the section `RESOURCES', and `option`(n), particularly the section on `option readfile`. Most jstools applications save their applicationspecific preferences in the same format in the file ~/.tk/application-defaults, 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@calumet.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.

### Changes

The Global Preferences panel has changed to accommodate other changes since jstools 3.6/2.0. In particular, the `vi bindings' and `Typing replaces selection' options are new.

### Future Directions

* I hope to overhaul the Preferences mechanism. I'd like to have some system similar to that in Brent Welch's `exmh` application, where preferences are organised into categories. I'd like a central preference panel to list the categories, and for each application to be able to add categories, instead of having separate global and applicationspecific panels. Also, I'd like to add an interface for editing all the standard Tk appearance resources, as described in `options`(n), so users don't have to edit defaults files by hand to adjust fonts, colours, relief options, etc.

``