BeginUpdate
BeginUpdate Signal start of window update
#include <Windows.h> Window Manager
void BeginUpdate(theWindow );
WindowPtr theWindow ; window you intend to update
Use BeginUpdate upon receiving an update event for a window. It
temporarily clips the window's visible region to that needing an update, and
purges that window's updateRgn.
theWindow is the window to update. It is normally obtained from the where
field of the EventRecord after a call to GetNextEvent indicates an
event of type updateEvt.
Returns: none

Notes: This saves a copy of theWindow 's visible region, then sets visRgn equal to
the conjunction of the visRgn and updateRgn, thus preparing to restrict
drawing to only those regions that are both visible and need an update.
Before making this call, you should save the current GrafPort (if
necessary), and set theWindow to be the current GrafPort. After this call,
you should draw the content region of the window, including any controls
that need to be drawn. It may be easiest to simply redraw the entire content
region since Quickdraw will clip all drawing to the restricted update region
automatically.
Finally, after finishing the re drawing, use EndUpdate and restore the
current GrafPort (if necessary).
Example
#include <Windows.h>
#include <Controls.h>
#include <ToolUtils.h>
/* ... after GetNextEvent() returns updateEvt for window myWin... */
UpdateMyWindow( myWin )
{
GrafPtr savedPort;
GetPort( &savedPort ); [TOKEN:12074] save current GrafPort */
SetPort( myWin ); [TOKEN:12074] make mine the current one */
BeginUpdate( myWin );
DrawGrowIcon( myWin ); /* Toolbox utility function */
DrawControls( myWin ); /* Control Manager function */
/* ... do whatever updating is needed -- redraw text, etc. ... */
EndUpdate( myWin );
SetPort( savedPort ); [TOKEN:12074] restore current GrafPort */
}