
User−interface library model
As illustrated above, the application itself may interact with all layers of the windowing system, the operating system,
and other libraries (math libraries, rpc, database) as needed. On the other hand, the user−interface portion of the
application should restrict itself to the Motif, Xt, and Xlib libraries whenever possible. This restriction aids in the
portability of the user−interface across multiple computers and operating systems. Since X is a distributed windowing
system, once the application runs on a particular computer, it can be displayed on any computer running X−−even
across a local or wide−area network.
In addition to restricting yourself to using the Motif, Xt, and Xlib libraries, you should try to use the higher−level
libraries whenever possible. Focus on using Motif−specific widgets and functions, rather than trying to implement
equivalent functionality using Xt or Xlib. An exception to this guideline is the use of Xt creation routines rather than
Motif convenience functions for creating simple widgets, as discussed later in the chapter. Higher−level libraries hide
a great number of details that you would otherwise have to handle yourself. By following these guidelines, you can
reduce code complexity and size, creating applications that are easier to maintain.
In situations where the Motif library does not provide the functionality you need, you ...