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


BeginUpdate

Use the BeginUpdate procedure to start updating a window when you receive an update event for that window.

PROCEDURE BeginUpdate (theWindow: WindowPtr);
theWindow
A pointer to the window's window record. Your application gets this information from the message field in the update event record.
DESCRIPTION
The BeginUpdate procedure limits the visible region of the window's graphics port to the intersection of the visible region and the update region; it then sets the window's update region to an empty region. After calling BeginUpdate, your application redraws either the entire content region or only the visible region. In either case, only the parts of the window that require updating are actually redrawn on the screen.

Every call to BeginUpdate must be matched with a subsequent call to EndUpdate after your application redraws the content region.

Note
In Pascal, BeginUpdate and EndUpdate can't be nested. That is,
you must call EndUpdate before the next call to BeginUpdate.
You can nest BeginUpdate and EndUpdate calls in assembly
language if you save and restore the copy of the visRgn, a copy
of which is stored, in global coordinates, in the global variable SaveVisRgn.
SPECIAL CONSIDERATIONS
If you don't clear the update region when you receive an update event, the Event Manager continues to send update events until you do.

SEE ALSO
See Figure 4-21 on page 4-49 for an illustration of how BeginUpdate and EndUpdate affect the visible region and update region. See Listing 4-10 on page 4-50 for an example that updates a window.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996