LENS

Files: Customization


It is possible to customize many aspects of the Lens graphical displays by placing a .lensrc file in your home directory or changing the "Src/lensrc.tcl" file if you have a personal version of Lens. Parameters that can be changed affect standard fonts, colors, which panels appear in the Main Window, how the Main Window is redrawn when a panel is popped in or out, which parameters appear in the Main Window, the default filters and directories for the file viewers, whether the manual is always spawned in a new browser window, your auto_load path to commonly used procedures, and any aliases or other commands that you may want to define.

When Lens boots up, it will source the standard configuration file, "Src/lensrc.tcl". It will then source the .lensrc file in your home directory. The .lensrc file is simply a Tcl script file. You may use the .lensrc file to override most definitions in the standard file. Therefore, you may place any procedures or aliases you would like in the file, or use the .lensrc to source other files containing these definitions. If you wish to make major changes, you may wish to edit a private copy of the lensrc.tcl but that should not be necessary.

To customize your version, you could either copy the lensrc.tcl to your .lensrc and then edit it or just copy those parts you wish to change. The effect will be the same. As with any Tcl script, lines beginning with a hash mark in the .lensrc are comments. The following are some things you may want to customize.

The standard fonts are designed to look pretty good on both high and low resolution displays, but they may be a bit big in low resolution.

The .mainColor sets the application-wide color "scheme". It will affect many different things. If you aren't into light gray, change this first and then, if you like, go mucking with all the other finer controls.

Or, if you'd just like a hint of color, change the .borderColor. May I recommend a sunny pastel? "light blue" or pink are charming, but are not to be used after Labor Day.

.registerParameter is used to specify which parameters will be accessible on the Main Window. If the first argument is "Algorithm", the parameter will appear on the Algorithm Panel. If it is "Training", the parameter will appear on the Training Panel. The second argument is the object path of the parameter and the third is its name. The fourth is a procedure used to prevent the user from entering bad values for the parameter. These procedures, which all begin with .enforce are defined in interface.tcl. The last two values will be the limit and int arguments to the enforcing procedure.

The next set of commands determine which panels will appear by default on the Main Window.

Try popping some panels out of the Main Window using the checkbuttons in the Window/Panels... pulldown menu. If it doesn't shrink properly, uncomment the two lines in the .redrawWindow procedure. Either that or get a better window manager.

If you don't use standard file extensions, you will want to change the filters used in the file browsers. A filter is a series of glob-style patterns. If any of the patterns match, the file name will be displayed.

.spawnNewManualWindow determines whether a new browser window will always be created when you run manual or whether an existing window will be taken over, which is the default. This only affects Netscape.

The auto_path is the directory path that Lens uses to find procedures during autoloading. You may wish to create a directory with a set of common procedures and put this on your auto path. There is no need to source the scripts in this directory as they will be sourced on demand, assuming index has been called properly.

tcl_precision is the decimal precision Tcl uses when converting from a float (which is always a double for Tcl) to a string. This will only affect calculations performed in the shell with expr, not the internal Lens calculations.

The defaultSigUSR1Proc and defaultSigUSR2Proc are run when Lens receives a USR1 or USR2 signal, respectively. These signals can be sent using the kill program. These can be used to force a network running in batch mode to perform a certain action while it is busy, like saving the current set of weights.

Finally, a number of procedures such as .initNetwork and .initGroup are defined in the lensrc.tcl file. These will be called whenever a structure of the corresponding type is created (and after the extensions are added to that structure), allowing you to set your own default values for fields in that structure, or to do whatever else you can think of.


Douglas Rohde
Last modified: Sat Nov 11 13:54:52 EST 2000