More Textbox Object methods














































More Textbox Object methods




More Textbox Object methods:

1)do_command(ch):
 It proces

Keystroke

Action

Control-A

Go to left edge of window.

Control-B

Cursor left, wrapping to previous line if appropriate.

Control-D

Delete character under cursor.

Control-E

Go to right edge (stripspaces off) or end of line (stripspaces on).

Control-F

Cursor right, wrapping to next line when appropriate.

Control-G

Terminate, returning the window contents.

Control-H

Delete character backward.

Control-J

Terminate if the window is 1 line, otherwise insert newline.

Control-K

If line is blank, delete it, otherwise clear to end of line.

Control-L

Refresh screen.

Control-N

Cursor down; move down one line.

Control-O

Insert a blank line at cursor location.

Control-P

Cursor up; move up one line.

Move operations do nothing if the cursor is at an edge where the movement is not possible. The following synonyms are supported where possible:

Constant

Keystroke

KEY_LEFT

Control-B

KEY_RIGHT

Control-F

KEY_UP

Control-P

KEY_DOWN

Control-N

KEY_BACKSPACE

Control-h

All other keystrokes are treated as a command to insert the given character and move right (with line wrapping).


2)stripspaces

This attribute is a flag which controls the interpretation of blanks in the window. When it is on, trailing blanks on each line are ignored; any cursor motion that would land the cursor on a trailing blank goes to the end of that line instead, and trailing blanks are stripped when the window contents are gathered.


Comments