Copyright © 2008, 2009 Arndt Roger Schneider
The RTL based option creator is used
to instantiate the template rtl_shell with a
Tk Window. The used creator window must have a
-class
property.
Acceptable Tk Windows are: toplevel for floating windows, and frame for embedded windows.
See the options manual entry for details on the standard options.
A valid Tcl-Interpreter. This interpreter must be
created through interp create
.
The current Tcl-Interpreter is used whenever the property is left empty.
String, defines what text shall being used as the prompt identifying the containing interpreter.
A string sequence, this sequence is used to change between the containing interpreter and the chosen slave interpreter.
The default switchcmd is »+-«.
Undocumented
Set where the scrollbars are inserted.
Possible values are: »top«, »bottom«, »left«, »right« and combinations thereof.
Undocumented
Requests additional space above each text line in the widget, using any of the standard forms for screen distances. If a line wraps, this option only applies to the first line on the display. This option may be overridden with -spacing1 options in tags.
For lines that wrap (so that they cover more than one line on the display) this option specifies additional space to provide between the display lines that represent a single line of text. The value may have any of the standard forms for screen distances. This option may be overridden with -spacing2 options in tags.
Requests additional space below each text line in the widget, using any of the standard forms for screen distances. If a line wraps, this option only applies to the last line on the display. This option may be overridden with -spacing3 options in tags.
Specifies a set of tab stops for the window. The option's value consists of a list of screen distances giving the positions of the tab stops. Each position may optionally be followed in the next list element by one of the keywords left, right, center, or numeric, which specifies how to justify text relative to the tab stop. Left is the default; it causes the text following the tab character to be positioned with its left edge at the tab position. Right means that the right edge of the text following the tab character is positioned at the tab position, and center means that the text is centered at the tab position. Numeric means that the decimal point in the text is positioned at the tab position; if there is no decimal point then the least significant digit of the number is positioned just to the left of the tab position; if there is no number in the text then the text is right-justified at the tab position. For example, -tabs {2c left 4c 6c center} creates three tab stops at two-centimeter intervals; the first two use left justification and the third uses center justification. If the list of tab stops does not have enough elements to cover all of the tabs in a text line, then Tk extrapolates new tab stops using the spacing and alignment from the last tab stop in the list. The value of the tabs option may be overridden by -tabs options in tags. If no -tabs option is specified, or if it is specified as an empty list, then Tk uses default tabs spaced every eight (average size) characters.
Specifies how to handle lines in the text that are too long to be displayed in a single line of the text's window. The value must be none or char or word. A wrap mode of none means that each line of text appears as exactly one line on the screen; extra characters that don't fit on the screen are not displayed. In the other modes each line of text will be broken up into several screen lines if necessary to keep all the characters visible. In char mode a screen line break may occur after any character; in word mode a line break will only be made at word boundaries.
String, defines what text shall being used as the prompt identifying the used slave interpreter.
A string substitution »%1$s« may occur in the local prompt string. This format substitution will be expanded with the current interpreter.
Example A.17. Local Prompt
-localprompt {vegetables %1$s :} \ -interp myLocalInterpreter; # Produces the following local prompt inside the # Rtl_shell: vegetables myLocalInterpreter :
The »rtl_shell« command creates a »rtl_shell« window.
»rtl_shell« is a primitive console window. It allows to switch between the containing interpreter and a slave interpreter.
The rtl_shell uses some additional option database entries to control the colouring of tags. These colours are normally derived from the rtl_shell »-foreground« and »-background« properties.
Advanced Colour Control
»alternateBackground«, defines the alternative background colour. Default is the rtl_shell background colour mixed with 11% gray.
»promptBackground« and »promptForeground« marks the shell line, where a switch between »prompt« and »localprompt« occurred. Default values are black on yellow.
A Window created through the rtl_shell command exposes various functions. Using these functions has the following general form:
pathName option ?arg arg ...?
PathName is the same as the window path name. Option and the args determine the exact behavior of the command. The following commands are possible for this window:
Returns the current value of the configuration option given by option. Option may have any of the values accepted by the rtl_shell command.
Query or modify the configuration options of the window. If no option is specified, returns a list describing all of the available options for pathName (see Tk_ConfigureInfo for information on the format of this list). If option is specified with no value, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no option is specified). If one or more option-value pairs are specified, then the command modifies the given window option(s) to have the given value(s); in this case the command returns an empty string. Option may have any of the values accepted by the rtl_shell command.
Inject a history script on the current prompt.
Secondary constructor for widgets of class shell
The given keystroke is a Backspace key and must be treated separately.
Pulled from openCmd, needed in multiple locations esp. when a dirty flag is currently set. Written : 09/28/2009, Roger
Insert new evaluated command to the public and private history list.
Emulate text insertion via puts from slave interpreters. Written : 01/28/2009, Roger
Allow to switch to the local prompt.
If args is given, ensure that the Local prompt is used instead of the global prompt. Args will be delivered to the registered procedure and allows to fill this procedure with more details. Revision : 09/18-28/2009, Roger
Finish command and try to evalute
Display the default prompt right after starting the shell. Revision : 09/28/2009, Roger
Browse the local history using the up key
Start a new command. Revision : 09/18-28/2009, Roger-prompt
Insert a new keystroke to the shell