XmTextPaste() gets the current data from the clipboard and places it in the Text widget. The routine returns
False if there is no data on the clipboard.
XmTextCut() and XmTextCopy() only work if there is a current selection in the specified Text widget, which
may be dependent on whether or not the user has made a selection. However, you can force a selection in a Text
widget using XmTextSetSelection(). This routine takes the following form:
void
XmTextSetSelection(widget, first, last, time)
Widget widget;
XmTextPosition first;
XmTextPosition last;
Time time;
XmTextSetSelection() selects the text between the specified positions in the Text widget. Once the text has
been selected, either XmTextCut() or XmTextCopy() may be called to place the selection on the clipboard.
Although XmTextGetSelection() does not deal with the clipboard directly, it provides a convenient way to get
the current selection from the corresponding Text widget. This routine takes the following form:
char *
XmTextGetSelection(widget)
Widget widget;
Note that the text returned by the routine is allocated data and must be freed by the caller using XtFree(). The
function returns NULL if the specified widget does not own the text selection.
To deselect the current selection in a Text widget, you can use XmTextClearSelection(), which takes the
following form:
void
XmTextClearSelection(widget, time)
Widget widget;
Time time;
18.4.2 The Owner of the Selection
Sometimes, if you have a large number of Text widgets, you may need ...