get-selection

Generic Function

Package: common-graphics

Arguments: stream

This function returns two numeric values indicating the start and end positions of the currently selected text of the control identified by stream, which must be a text control of some sort or a text-edit-window or text-edit-pane.

If there is no text selected, then the two returned values are equal and indicate the current text cursor position; zero indicates the beginning of the text.

See also set-selection, selected-object, selected-string, and selected-symbol. Those functions may return true when no text is highlighted (they can return the text surrounding the text cursor as well as highlighted text). Menu command such as Cut only work on highlighted text. get-selection can be used, either alone or in conjunction with those functions, to determine whether menu-items that work on selected or highlighted text should be made unavailable. See about-to-show-menu, which is called prior to a menu being displayed.

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.