set-selection

Generic Function

Package: common-graphics

Arguments: stream start &optional (end start)

Sets the selected text in stream, which must be a text-edit-window, text-edit-pane, 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 at before the character at start, but no text is selected. Indexing is zero-based so the first character is index 0. Two invisible characters typically appear at the end of a line.

This function also works on a editor buffer (an instance of lisp-pane, though that class is not supported for application). 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.

Note: incompatible change in release 6.0: in releases prior to 6.0, when a frame-with-single-child instance was passed to this operator, the operator was actually applied to the child (the result of applying frame-child to the frame-with-single-child instance). In release 6.0, this redirection no longer occurs. If you intend this operator to apply to the frame-child, pass that to this operator rather than the parent. This is a non-backward-compatible-change. See the release notes for more information.

Common Graphics and IDE documentation is described in About Common Graphics and IDE documentation in cgide.htm.

The documentation is described in introduction.htm and the index is in index.htm.

Copyright (c) 1998-2000, Franz Inc. Berkeley, CA., USA. All rights reserved.

Created 2000.10.5.