XmTextPaste() gets the current selection from the clipboard and inserts it at the location of the insertion cursor. If
there is some selected text in the Text widget, that text is replaced by the selection from the clipboard.
XmTextPaste() returns True if there is a selection on the clipboard that can be retrieved.
XmTextClearSelection() deselects the text selection in the Text widget. If there is no selected text, nothing
happens. The routine does not provide any feedback or return any value. Any text that is held on the clipboard or in a
selection property remains.
One additional convenience routine that operates on the selection is XmTextRemove(). This function is like
XmTextCut(), in that it removes the selected text from a Text widget, but it does not place the text on the clipboard.
15.3.1 Getting the Selection
You can get the selected text from a Text widget using XmTextGetSelection(), which takes the following form:
char *
XmTextGetSelection(text_w)
Widget text_w;
This routine returns allocated data that contains the selected text. This text must be freed using XtFree() when you
are through using it. The routine returns NULL if there is no text selected in the Text widget.
XmTextGetSelectionPosition() provides information about the selected text in a Text widget. This routine
takes the following form:
Boolean
XmTextGetSelectionPosition(text_w, left, right)
Widget text_w;
XmTextPosition *left;
XmTextPosition *right;
If XmTextGetSelectionPosition() returns True, the values for left ...