This program displays a textual region. The textual region is initially empty. Characters typed are displayed in the textual region at the position of the text cursor.
Users can move the text cursor by selecting anywhere in the textual region's window. The cursor moves to the character position selected.
An EXIT key is also defined and displayed. When the user selects this key, ESL exits the program.
# OBJECTS
primary graphical region Primary_GR
size 900 500 at 40 40
in desktop
# Following is the definition of the textual region. Its
# window is 24 columns wide and 12 lines long and there
# is a border around it:
enabled blue textual region TextReg
window size 24 columns 12 lines
at position 100 100
in Primary_GR
white border
font "large"
# Following is the definition for the EXIT key. It is
# displayed as a box with the word "EXIT" centered inside
# it:
red key ExitKey at position 600 100
in Primary_GR
box 100 80
move to 50 40
font "large" text center "EXIT"
# The following response definition causes the text
# cursor to be visible when ESL begins:
response to start
make TextReg cursor visible
# The following response definition causes the text
# cursor to move to the point selected when the textual
# region is selected:
response to TextReg
add to TextReg
move to column xcoord line ycoord
# The following response definition inserts a character
# typed at the keyboard into the textual region at the
# position of the text cursor:
response to char from keyboard
add to TextReg
insert input
# The following response definition causes ESL to
# terminate when the EXIT key is selected:
response to ExitKey
exit