Window-specific Options

Command-Line Name: -interp, Database Name: interp, Database Class; -

A valid Tcl-Interpreter. This interpreter must be created through interp create.

The current Tcl-Interpreter is used whenever the property is left empty.

Command-Line Name: -prompt, Database Name: prompt, Database Class; -

String, defines what text shall being used as the prompt identifying the containing interpreter.

Command-Line Name: -switchcmd, Database Name: switchcmd, Database Class; -

A string sequence, this sequence is used to change between the containing interpreter and the chosen slave interpreter.

The default switchcmd is »+-«.

Command-Line Name: -maxbuffer, Database Name: maxbuffer, Database Class: -

Undocumented

Command-Line Name: -sides, Database Name: sides, Database Class; -

Set where the scrollbars are inserted.

Possible values are: »top«, »bottom«, »left«, »right« and combinations thereof.

Command-Line Name: -copyright, Database Name: copyright, Database Class: -

Undocumented

Command-Line Name: -spacing1, Database Name: spacing1, Database Class; Spacing1

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.

Command-Line Name: -spacing2, Database Name: spacing2, Database Class; Spacing2

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.

Command-Line Name: -spacing3, Database Name: spacing3, Database Class; Spacing3

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.

Command-Line Name: -tabs, Database Name: tabs, Database Class; -

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.

Command-Line Name: -wrap, Database Name: wrap, Database Class; -

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.

Command-Line Name: -localprompt, Database Name: localprompt, Database Class; -

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.


Description

Figure 5.1. rtl_shell


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.

Window Command

A Window created through the rtl_shell command exposes various functions. Using these functions has the following general form:

(option object ?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:

(cget object :option)

Returns the current value of the configuration option given by option. Option may have any of the values accepted by the rtl_shell command.

(configure object ?:option? ?value option value ...?)

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.

(down object )

See above up-key

(insertScript object )

Inject a history script on the current prompt. Revision : 10/05/2009, Roger-change insert position

(init object )

Secondary constructor for widgets of class shell Creates the initial tags »error«, »valid«, »display«, »alternate« and »valid«.

Notice the generated tags are customized through the font, foreground and background properties. These tags are customized inisde of the repective properties.

(backspace object type )

The given keystroke is a Backspace key and must be treated separately.

(printPrompt object )

Pulled from openCmd, needed in multiple locations esp. when a dirty flag is currently set. Written : 09/28/2009, Roger

(add object cmd )

Insert new evaluated command to the public and private history list.

(insertText object channel string )

Emulate text insertion via puts from slave interpreters. Written : 01/28/2009, Roger

(toggle object ... )

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

(returnCmd object )

Finish command and try to evalute.

(initialPrompt object )

Display the default prompt right after starting the shell. Revision : 09/28/2009, Roger

(up object )

Browse the local history using the up key

(openCmd object r ?tag? )

Start a new command. Revision : 09/18-28/2009, Roger-prompt

(insertKey object key )

Insert a new keystroke to the shell. Revision : 09/29/2009, Roger-cleanup