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 / Using the Window Manager


Maintaining the Update Region

Your application can force and suppress update events by manipulating the update region, using Window Manager routines provided for this purpose.

Your application usually manipulates the update region, for example, when the user resizes a window that contains a size box and scroll bars. If the user enlarges the window, the Window Manager adds the newly exposed area to the window's update region but does not add the area formerly occupied by the scroll bars. Before calling the SizeWindow procedure to resize the window, your application can call the InvalRect procedure twice to add the scroll bar and size box areas to the update region. The next time it receives an update event, your application erases the scroll bars and draws whatever parts of the document content might be visible at that location.

Similarly, you can remove an area from the update region when you know that it is in fact valid. Limiting the size of the update region decreases time spent redrawing. Listing 4-13 on page 4-51, for example, uses the ValidRect procedure to remove the unaffected text area from the update region of a window that is being resized.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996