Window Update Regions

As the user creates, moves, resizes, and closes windows on the desktop, portions of windows may be obscured and uncovered. The Window Manager keeps track of these changes, accumulating a dynamic region known as the update region for each window. The update region contains all areas of a window's content region that need updating. The Event Manager periodically scans the update regions of all windows on the desktop, generating update events for windows whose update regions are not empty. When your application receives an update event, it should redraw the update region.

Both your application and the Window Manager can manipulate a window's update region. Your application can force or suppress update events by manipulating the update region, using Window Manager functions provided for this purpose. For example, in order to decrease the time that your application spends redrawing window content, you can remove an area from the update region when you know that it is in fact valid.

The Mac OS 8.5 Window Manager provides enhanced functions for manipulating the update region. They are similar to previous Window Manager functions but allow the window that you are operating upon to be explicitly specified, instead of operating on the current graphics port, so they do not require you to set the graphics port before their use. As possible, you should update pre-Mac OS 8.5 applications to use these functions rather than the pre-existing ones, so that your code more readily supports future versions of the Mac OS.

The Mac OS 8.5 Window Manager provides the following functions for updating windows. See Maintaining the Update Region for a discussion of how your application can use these functions.


� 1999 Apple Computer, Inc. – (Last Updated 18 March 99)