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



DrawingArea: A General-Purpose Widget

DrawingArea is a manager with little specific behavior of its own. It provides basic geometry management for widget and gadget children. It also has callback lists that provide the application with low-level event handling. An application can use these features to implement a canvas or a more specialized widget. Of course, you may also want to write your own widget rather than trying to add specific features to DrawingArea. (See the Motif Widget Writer's Guide for details.)

By default, a DrawingArea attempts to adjust its size to contain all its children just inside its margins. The DrawingArea resource XmNresizePolicy determines how the DrawingArea responds to geometry requests from its children. This resource has three possible values:

XmRESIZE_ANY
The DrawingArea tries to accept requests that would cause the DrawingArea to grow or shrink to enclose all its children. This is the default.

XmRESIZE_GROW
If its parent approves, the DrawingArea accepts requests from its children that would cause the DrawingArea to grow. It may accept requests that would cause it to shrink, but it does not reduce its size.

XmRESIZE_NONE
The DrawingArea has a fixed size determined by its XmNheight and XmNwidth resources. It rejects geometry requests from its children that would cause the DrawingArea to grow. It may accept requests that would cause it to shrink, but it does not reduce its size.

The DrawingArea resources XmNmarginHeight and XmNmarginWidth also affect geometry management. When the value of XmNmarginHeight is greater than 0, the DrawingArea ensures that the top edges of all children are inside the top margin. When the value of XmNmarginWidth is greater than 0, the DrawingArea ensures that the left edges of all children are inside the left margin.

See Chapter 14 for more information on DrawingArea's geometry management.


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