| Allegro CL version 7.0 Moderately revised from 6.2. | |||||||||
Arguments: stream start &optional (end start)
Sets the selected text in stream, which must be a
text-edit-pane
or a text control (such as an editable-text or multi-line-editable-text), to be
the characters indexed by start (inclusive) and
end (exclusive). If start
equals end, the cursor is placed before the
character at start, but no text is
selected. Indexing is zero-based so the first character is index
0. The end of the buffer may be specified by passing
start or end as a very large
integer such as the value of most-positive-fixnum.
Since a text-edit-pane is a stream, the
function file-position may alternately be
used to return or set its text cursor position, and file-length will return the index
of the end of the buffer. (Calling window on a multi-line-editable-text widget
will return its associated text-edit-pane.)
This function also works on editor buffers (instances of lisp-edit-pane). For a
simple test of this function, open an editor window (click View | New
Editor if necessary). Click on Tools | Get Component
and click on the editor pane. The object will be returned in the Debug
Window. In the Debug Window, evaluate
(setq lp *)
Now, in the editor pane, enter
0123456789 0123456789
(with no spaces).
(set-selection lp 0 2) selects 01 in the
first line.
(set-selection lp 0 10) selects all
characters in the first line.
(set-selection lp 0 13) selects all the
first line and 0 in the second line. (the 11th and 12th characters are
the carriage-return and linefeed).
See also get-selection.
Copyright (c) 1998-2006, Franz Inc. Oakland, CA., USA. All rights reserved.
This page has had moderate revisions compared to the 6.2 page.
Created 2005.9.20.
| Allegro CL version 7.0 Moderately revised from 6.2. | |||||||||