Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Macintosh Toolbox Essentials /
Chapter 4 - Window Manager / Window Manager Reference
Window Manager Routines / Maintaining the Update Region


ValidRect

Use the ValidRect procedure to remove a rectangle from a window's update region.

PROCEDURE ValidRect (goodRect: Rect);
goodRect
A rectangle, in local coordinates, to be removed from a window's
update region.
DESCRIPTION
The ValidRect procedure removes a specified rectangle from the update region of the window whose graphics port is the current port. Specify the region in local coordinates. The Window Manager clips it, if necessary, to fit in the window's content region.

Your application uses ValidRect to tell the Window Manager that it has already drawn a rectangle and to cancel any updates accumulated for that area. You can thereby improve response time by reducing redundant redrawing.

Suppose, for example, that you've resized a window that contains a size box and
scroll bars. Depending on the dimensions of the newly sized window, the new size
box and scroll bar areas may or may not have been accumulated into the window's update region. After calling SizeWindow, you can redraw the size box or scroll bars immediately and then call ValidRect for the areas they occupy. If they were in fact accumulated into the update region, ValidRect removes them so that you do not have to redraw them with the next update event.

SEE ALSO
See Listing 4-13 on page 4-58 for an example that uses ValidRect to remove part of the window's content region from the update region.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996