{jprefpanel.tcl

Introduction
The jprefpanel.tcl library is distributed as part of the jstools package.  It a single procedure which creates the jstools Global Preferences panel.

This document describes jprefpanel.tcl version 4.0/4.0.

Usage
Accessing the Library
In order to use the jprefpanel.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@calumet.org
http://shore.net/~js/

Copyright
The library is copyright © 1992-1995 by Jay Sekora, but may be freely redistributed under the conditions at the top of the file.

Overview
Procedures
j:global_pref_panel - create the jstools Global Preferences panel

See Also
	jprefs.tcl

j:global_pref_panel
Usage
	j:global_pref_panel [options]
Option
	-title title  (localisable, default Global Preferences)

Description
This procedure creates a preference panel that lets users set preferences intended to be shared across multiple applications.  Global preferences are accessed by applications as elements of the global J_PREFS array, and saved in X resource format in the file ~/.tk/defaults.

The main part of the panel contains various kinds of controls to manipulate particular preferences.  At the bottom of the panel are two buttons labelled `Save' and `Done'.  (Save is the default button.)  The Done button simply dismisses the panel; the application will use whatever preferences are currently shown, but they will not be saved across sessions.  The Save button writes the current preferences into the file ~/.tk/defaults before dismissing the panel, so that they can be read in the next time the application starts, or by other applications.

If title is specified, it will be the title of the panel, for use by the window manager.

Documentation for the Global Preferences panel itself (as opposed to the library) is available in The jstools Global Preferences Panel.

Currently, the controls available and the preferences they manipulate are:

Auto­position dialogue boxes
Checkbutton; sets J_PREFS(autoposition)
(Used by j:dialogue)

Confirm actions
Checkbutton; sets J_PREFS(confirm)
(Used by j:alert)

Fast file selector
Checkbutton; sets J_PREFS(j_fs_fast)
(Used by j:fs)

Visible Bell
Checkbutton; sets J_PREFS(visiblebell)
(Used by j:beep)

Audible Bell
Checkbutton; sets J_PREFS(audiblebell)
(Used by j:beep)

Strict Motif emulation
Checkbutton; sets J_PREFS(tk_strictMotif) and tk_strictMotif
(Used by Tk itself.  Changing this preference currently has no effect until the next time the application is run; this might be considered a bug.)

Basic bindings
Radiobutton; sets J_PREFS(bindings) to basic
(Used by j:init; can also be checked by your code.)

vi bindings
Radiobutton; sets J_PREFS(bindings) to vi
(Used by j:init; can also be checked by your code.)

EDT bindings
Radiobutton; sets J_PREFS(bindings) to EDT
(Used by j:init; can also be checked by your code.)

Emacs bindings
Radiobutton; sets J_PREFS(bindings) to emacs
(Used by j:init; can also be checked by your code.)

Printer:
Entry field; sets J_PREFS(printer)
(Used by j:more; can also be used by your application.  Note that in the current version of the library, it does not set the PRINTER environment variable.)

In addition to using commands in the jbindings.tcl or jinit.tcl libraries to set default text and entry bindings, your application may wish to consult the value of J_PREFS(bindings) in order to choose bindings for commands that it defines.  For instance, you may wish to use `/' (a slash) to start a search if the user has selected vi or basic bindings, but Control-s if the user has selected Emacs bindings.  Likewise, you might bind either `ZZ' or Control-x Control-q to save a document, depending on the user's preferred bindings.

Additional global preferences are likely to be defined in future versions of the library.

Future Directions
I want to implement a much more general preferences mechanism along the lines of that provided by Brent Welch's exmh application.  Then there would be one Preferences panel available in each application, which would let the user get at application­specific preferences as well as global preferences.
} {{{display:foreground:Red {10.287 11.0}} {jdoc:xref:link {4.57 4.64 4.111 4.147 10.215 10.236 10.244 10.261 10.265 10.286 23.0 23.19 23.29 23.65 26.1 26.11 32.16 32.27 41.98 41.134}} {jdoc:xref:manpage {10.131 10.138}} {jdoc:anchor:anchorname {3.0 4.0 8.0 9.0 12.0 13.0 21.0 22.0 28.0 29.0}} {richtext:font:roman {2.0 3.0 4.0 4.4 4.18 4.57 4.64 4.115 4.122 6.24 6.38 8.0 9.21 10.20 10.34 10.107 10.116 10.131 10.138 10.219 10.226 10.248 10.253 10.265 10.286 10.287 11.0 12.0 14.0 15.0 15.14 16.0 16.21 18.0 19.0 21.0 23.19 23.33 23.40 25.0 26.0 26.1 26.11 28.0 30.21 30.22 30.29 31.0 32.15 32.37 32.55 34.0 35.0 35.201 35.208 35.259 35.273 37.421 37.435 39.3 39.8 41.98 41.134 45.0 46.0 46.18 46.39 47.9 47.19 49.0 50.0 50.18 50.34 51.9 51.16 53.0 54.0 54.18 54.36 55.9 55.13 57.0 58.0 58.18 58.38 59.9 59.15 61.0 62.0 62.18 62.38 63.9 63.15 65.0 66.0 66.18 66.41 66.46 66.60 69.0 70.0 70.18 70.35 70.39 70.44 71.9 71.15 73.0 74.0 74.18 74.35 74.39 74.41 75.9 75.15 77.0 78.0 78.18 78.35 78.39 78.42 79.9 79.15 81.0 82.0 82.18 82.35 82.39 82.44 83.9 83.15 85.0 86.0 86.18 86.34 87.9 87.15 87.125 87.132 89.37 89.50 89.54 89.63 89.164 89.181 89.276 89.277 89.358 89.367 89.443 89.445 89.450 89.459 89.460 89.469 93.0 94.0 94.112 94.116 95.0}} {richtext:font:italic {30.22 30.29 32.8 32.13 39.3 39.8}} {richtext:font:bold {4.4 4.18 4.57 4.64 4.115 4.122 6.24 6.38 10.20 10.34 10.219 10.226 26.1 26.11 35.259 35.273 37.421 37.435 89.37 89.50 89.54 89.63 89.358 89.367 89.450 89.459 89.460 89.469}} {richtext:font:bolditalic {10.248 10.253 10.265 10.286 41.98 41.134}} {richtext:font:typewriter {10.107 10.116 10.131 10.138 15.0 15.14 16.0 16.21 23.0 23.19 23.33 23.40 30.0 30.21 32.0 32.8 32.13 32.15 32.37 32.55 35.201 35.208 46.18 46.39 47.9 47.19 50.18 50.34 51.9 51.16 54.18 54.36 55.9 55.13 58.18 58.38 59.9 59.15 62.18 62.38 63.9 63.15 66.18 66.41 66.46 66.60 70.18 70.35 70.39 70.44 71.9 71.15 74.18 74.35 74.39 74.41 75.9 75.15 78.18 78.35 78.39 78.42 79.9 79.15 82.18 82.35 82.39 82.44 83.9 83.15 86.18 86.34 87.9 87.15 87.125 87.132 89.164 89.181 89.276 89.277 89.443 89.445 94.112 94.116}} {richtext:font:heading0 {1.0 2.0}} {richtext:font:heading1 {3.0 4.0 8.0 9.0 12.0 13.0 21.0 22.0 28.0 29.0 93.0 94.0}} {richtext:font:heading2 {9.0 9.21 10.287 11.0 13.0 14.0 18.0 19.0 22.0 23.0 25.0 26.0 29.0 30.0 31.0 32.0 34.0 35.0}} {richtext:font:heading3 {45.0 46.0 49.0 50.0 53.0 54.0 57.0 58.0 61.0 62.0 65.0 66.0 69.0 70.0 73.0 74.0 77.0 78.0 81.0 82.0 85.0 86.0}} {{} {10.248 10.261 12.0 19.0 20.0 23.0 27.0 28.0}} {jdoc:link:jstools.jdoc {4.57 4.64}} {jdoc:manpage:tclvars {10.131 10.138}} {jdoc:link:jslibraries.jdoc#Usage {10.244 10.261}} {jdoc:link:jslibraries.jdoc {10.265 10.286}} {jdoc:anchorname:Credits_and_Copyright {12.0 13.0}} {jdoc:anchorname:Introduction {3.0 4.0}} {jdoc:anchorname:Usage {8.0 9.0}} {jdoc:topic:jstools {4.57 4.64}} {jdoc:link:jslibraries.tcl {10.215 10.236}} {jdoc:anchorname:Overview {21.0 22.0}} {jdoc:link:panels/prefs.jdoc {4.111 4.147 23.29 23.65 41.98 41.134}} {jdoc:link:jprefs.tcl.jdoc {26.1 26.11}} {jdoc:anchorname:j:global_pref_panel {28.0 29.0}} {jdoc:link:#j:global_pref_panel {23.0 23.19}} {jdoc:link:localisable.jdoc {32.16 32.27}}} {{richptr 84.0} {del_from 95.0} {matchend 95.0} {abbrevstart 39.88} {abbrevend 39.88} {insert 1.0} {del_to 4.148} {matchstart 95.0} {anchor 1.0} {emacs_mark 95.0} {current 5.0}}}