Generic FunctionPackage: cgToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.0
Unrevised from 9.0 to 10.0.
9.0 version

selected-string

Arguments: window

Returns a string that is considered to be selected in window and which may be acted upon by arbitrary commands that require a string. nil (which is not a string) is returned if nothing is selected, even by the wide definition of selected described next.

Note: this function will return true both when text is selected and highlighted (after, perhaps, the left mouse button is depressed and dragged over the text) and when the cursor is within text but no text is highlighted. Thus, if the cursor is between the `f' and the first `o' of `foo', "foo" will be returned by selected-string even though no text is highlighted. Further, if only part of a word is highlighted (say just the `o' in `foo', "foo" will again be returned.

While some menu commands work on text selected by grabbing the whole word when no text is actually selected, others, Cut for example, do not work in that case. Also, there are cases when you want the exact text selected (when some text is selected) rather than the whole enclosing word. In these cases, you should use get-selection rather than selected-string.

The function get-selection returns two integers indicating the beginning and the end of highlighted text. If the two values returned by that function are equal, no text is highlighted and commands that only work on highlighted text should not be invoked. The values can also be used to get the precise text selected rather than the enclosing word.


Copyright (c) 1998-2019, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 9.0 page.
Created 2015.5.21.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.0
Unrevised from 9.0 to 10.0.
9.0 version