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

Exposure and Redisplay

A widget can recompute its layout in its resize, set_values, or geometry_manager method, but usually it does not actually generate the window contents in those methods. A widget usually regenerates its window contents in response to an Expose event, which causes the widget's expose method to be invoked. This method takes as arguments the widget, the event, and the set of rectangles to be redisplayed. Using the current state of the widget (including its geometry resources), the expose method generates the contents of either the affected rectangles or the window as a whole.

XmeConfigureObject, XtConfigureWidget, XtResizeWidget, and XtMoveWidget cause the server to generate Expose events when necessary. XtMakeGeometryRequest also causes the server to generate Expose events when the parent's geometry_manager method returns XtGeometryYes.

The expose method of all Motif manager widgets should call the XmeRedisplayGadgets routine. This routine passes exposure events down to all the gadget children of the manager. For example, following is the entire Redisplay method of ExmGrid:

static void
Redisplay (
        Widget w,
        XEvent *event,
        Region region)
  /* Pass exposure event down to gadget children. */
    XmeRedisplayGadgets (w, event, region);

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