[ Previous | Next | Contents | Glossary | Home | Search ]
Motif 2.1 Widget Writer's Guide



Chapter 10. Data Transfer Between Widgets with UTM

Motif provides several mechanisms for transferring data from one widget to another. For example, Motif users can use any of the following mechanisms to move text between any two XmText widgets:

  1. Primary selection

  2. Secondary selection

  3. Clipboard

  4. Drag and drop

    From a user's point of view, each of these data transfer methods is rather different; each one is accomplished by pressing different combinations of keys or mouse buttons. From a Motif widget writer's point of view, however, there are a number of similarities in implementing them. These similarities in data transfer implementation fit under the umbrella term "Uniform Transfer Model" (UTM).

    UTM is not a user-accessible data transfer mechanism. In other words, there is no magic sequence of keys that will allow a user to transfer data through UTM. Rather UTM is simply a way for a widget writer (and possibly, an application programmer) to implement one of the four data transfer mechanisms.

    UTM gives the widget writer the following arsenal of software for implementing data transfer:

    1. A group of Xme functions

    2. A group of Xm functions

    3. The XmQTtransfer trait

    4. Two new callback structures

      One way to think of UTM is that it is a convenient front end (or wrapper) to existing data transfer mechanisms. You could, for example, implement primary transfer with existing Xt and Motif calls. However, you would probably find it far easier to implement primary transfer through UTM. You will almost certainly find it easier to implement data transfer through UTM when your widget supports more than one transfer mechanism.

      UTM is completely compatible with the ICCCM (the Inter-Client Communications Conventions Manual). In fact, to get the most out of this chapter, you should already be comfortable with the material in the ICCCM. We do, however, provide the following tutorial for those whose knowledge may need a little refreshing.


    5. [ Previous | Next | Contents | Glossary | Home | Search ]