3 global selection support – Compaq DEC Text Processing Utility AA-PWCBD-TE User Manual
Page 106
DEC Text Processing Utility Program Development
5.2 Programming in DECwindows DECTPU
5.2.3 Global Selection Support
Global selection in DECwindows is a means of preserving information selected
by you so your selection, or data about your selection, can pass between
DECwindows applications. Each DECwindows application can own one or
more global selections.
5.2.3.1 Difference Between Global Selection and Clipboard
A global selection differs from the clipboard in that the global selection changes
dynamically as you change the select range, while the contents of the clipboard
remain unchanged until you use a command (such as EVE’s STORE TEXT
command) that sends new information to the clipboard. By default EVE does not
use the clipboard.
5.2.3.2 Handling of Multiple Global Selections
At any particular time, a global selection is owned by at most one DECwindows
application; a global selection can also be unowned. A DECwindows application
can own more than one global selection at the same time. For example, an
application layered on DECTPU can own both the primary and secondary global
selections. The DECwindows server determines which application currently owns
which global selection.
Information about a global selection property may be stored in different formats,
but the format of a particular property must be the same for all DECwindows
applications. DECTPU directly accepts information that is stored in integer
or string format. DECTPU handles information in other formats by describing
the information in an array. For more information about this array, see the
descriptions of the GET_GLOBAL_SELECT and WRITE_GLOBAL_SELECT
built-in procedures in the DEC Text Processing Utility Reference Manual.
Global selections are identified in DECTPU either as strings or keywords. While
DECwindows provides for many global selections, applications conforming to
the Motif Style Guide are concerned with only two selections—the primary
and secondary selections. DECTPU provides a pair of keywords (PRIMARY
and SECONDARY) to refer to these selections. DECTPU also provides built-
in procedures that enable layered applications to manipulate global selection
information.
You can refer to other global selections by specifying a string instead of the
keywords PRIMARY and SECONDARY. For example, if your application has a
global selection whose name is auxiliary, use the string
"
auxiliary
"
to specify the
selection. Selection names are case sensitive; the string
"
auxiliary
"
does not refer
to the same global selection as the string
"
AUXILIARY
"
.
5.2.3.3 Relation of Global Selection to Input Focus
An application that conforms to the Motif Style Guide requests ownership of the
primary global selection in its input focus grab procedure. Regardless of whether
the application conforms, when DECTPU gets the input focus, it automatically
grabs the primary global selection if it is not already the owner.
An application cannot prevent DECTPU from attempting to assert ownership of
the primary global selection when DECTPU receives the input focus. If DECTPU
gets the primary selection by grabbing ownership itself, DECTPU automatically
executes the application’s global selection grab routine if one is present. If you are
writing an application that conforms to the Motif Style Guide and you find that
DECTPU has had to grab ownership of the primary selection itself and execute
the global select grab routine, your application may have a design problem.
5–6 DEC Text Processing Utility Program Development