Adding Accelerator Buttons to SAOtng

The Accelerator command buttons located on the left side of the SAOtng GUI provide a quick means of executing common menu options. The default functions executed by these buttons are maintained an an ASCII file called accel.cmds in the SAOtng bin directory. Use the -accel [accel list] switch to supply an alternate set of command functions.

The accel list file is an ASCII file containing a list of (up to 20) accelerator commands. Each command consists of a name, type, and action. The name is the button name (less than 7 characters to fit in the default label). The type is either "xpa" or "tcl". The action is either an XPA command to send to SAOtng or a fragment of TCL code to execute.

For example, the default accel.cmds file includes the following commands:

    # label	type	command			color
    # -----	----	-------			____
    "NxtFram"	xpa	"frame next"		tomato
    "PrvFram"	xpa	"frame prev"		tomato
    "Linear"	xpa	"scale linear"		orange
    "Log"	xpa	"scale log"		orange
    "Sqrt"	xpa	"scale sqrt"		orange
    "NoScale"	xpa	"scale none"		orange
    "Grey"	xpa	"colormap Grey"		yellow
    "A"		xpa	"colormap A"		yellow
    "B"		xpa	"colormap B"		yellow
    "I8"	xpa	"colormap I8"		yellow
    "Invert"	xpa	"colormap invert"	yellow
    "Zoom 1"	xpa	"zoom abs 1"		palegreen
    "x2"	xpa	"zoom rel 2"		palegreen
    "x1/2"	xpa	"zoom rel 0.5"		palegreen
    "FlipY"	xpa	"zoom flip y"		palegreen
    "Print"	tcl	"PrintImage"		lightskyblue
    "Panner"	tcl	"global panner_enable; setPanner [expr !$panner_enable]" lightskyblue
    "RA/Dec"	tcl	"SetCoords hms"		lightskyblue
    "Pixels"	tcl	"SetCoords pixels"	lightskyblue

Note that the color of the accelerator buttons are defined in the file that specifies the buttons and their functions. In the default case, we have grouped similar menu functions with the same color. Those who are distracted by different colors can use the -accelcolor [color] switch to change all buttons to a single color.


Return to Advanced Topics Page

Return to Main SAOtng Help Page

Last Updated May 1, 1995