Next: , Previous: , Up: Classes   [Index]


ANSITextBoxPane

ANSITextBoxPane Class

An ANSITextBoxPane object displays a text-mode dialog box with an application’s text in the window, and a “Dismiss” button at the bottom of the display area. Like other widgets that are subclasses of ANSIWidgetPane, you can close the window by pressing Esc or Enter, and you can scroll through the text with the terminal’s up and down arrow keys, the vi keys j and k, and the emacs keys C-n and C-p.

Here is a brief example of how to open and display text in an ANSITextBoxPane object.

int main () {
  ANSITextBoxPane new textBox;

  textBox resize 75, 30;

  textBox appendLine "Hello, world!";
  textBox appendLine "This is another line of text.";
  textBox appendLine "More text to follow.";

  textBox show 1, 1;

  textBox cleanup;
}

Instance Variables

dismissButton

An ANSIButtonPane object that displays a “Dismiss” button at the bottom of the pane’s display area.

text

A List object that contains the text to be displayed in the pane, one line per list element.

viewStartLine

An Integer object that indicates the topmost line of text to be displayed in the pane.

viewHeight

An Integer that contains the height of the pane’s text display area. The text display area is the width and height of the pane, not including a window border if any, and not including the bottom five lines of the pane, which is used to display the dismissButton widget.

viewWidth

An Integer that contains the width of the viewable text area. As mentioned above, the viewWidth dimension is the width of the pane minus the window borders, if any.

viewXOffSet

An Integer that contains the starting column of each line within the window.

Instance Methods

appendLine (String text)

Append a line to the widget’s text (class List) instance variable. The text will be visible after the next refresh message.

cleanup (Integer lineNumber)

Delete the extra buffers that the receiver uses for screen data. The normal object cleanup routines delete the receiver pane itself.

clearLine (Integer lineNumber)

Erase the line lineNumber in the pane’s view area.

handleInput (void)

Wait for the user’s input from the keyboard and redisplay or withdraw the receiver widget depending on which key the user presses.

new (String paneName)

Constructs a new ANSITextBoxPane object. The object’s dimensions are 40 columns wide by 20 rows high, with a “Dismiss” button at the bottom of the window, and with a border and shadow.

If more that one name is given in the argument list, construct new ANSITextBoxPane objects with the labels’ names.

refresh (void)

Redraws the receiver object and any text to be displayed in the pane’s visible area.

resize (Integer xSize, Integer ySize)

Resize the pane to the dimensions xSize, ySize.

show (Integer xOrigin, Integer yOrigin)

Pop up the pane’s window at the terminal coordinates xOrigin, yOrigin, and wait for the user’s input.


Next: , Previous: , Up: Classes   [Index]