Important: The information in this document is obsolete and should not be used for new development.
UpdateControls
To update controls in a window, you can use theUpdateControls
procedure. TheUpdateControls
procedure is also available as theUpdtControl
procedure.
PROCEDURE UpdateControls (theWindow: WindowPtr; updateRgn: RgnHandle);
theWindow
- A pointer to the window containing the controls to update.
updateRgn
- The update region within the specified window.
DESCRIPTION
TheUpdateControls
procedure draws those controls that are in the specified update region. This procedure is faster than theDrawControls
procedure, which draws all of the controls in a window. By contrast,UpdateControls
draws only those controls in the update region.Your application should call
UpdateControls
upon receiving an update event for a window that contains controls. Window Manager routines such asSelectWindow
,ShowWindow
, andBringToFront
do not automatically callDrawControls
to display the window's controls. They just add the appropriate regions to the window's update region, generating an update event.In response to an update event, you normally call
UpdateControls
after using the Window Manager procedureBeginUpdate
and before using the Window Manager procedureEndUpdate
. You should set theupdateRgn
parameter to the visible region of the window's port, as specified in the port'svisRgn
field.SPECIAL CONSIDERATIONS
If your application draws parts of a control outside of its rectangle,UpdateControls
might not redraw it.The Dialog Manager handles update events for controls in alert boxes and dialog boxes.
SEE ALSO
Listing 5-8 on page 5-27 illustrates the use ofUpdateControls
. TheBeginUpdate
andEndUpdate
procedures are described in the chapter "Window Manager" in this book. See the chapter "Dialog Manager" in this book for more information about including controls in alert boxes and dialog boxes.