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 theUpdateControlsprocedure. TheUpdateControlsprocedure is also available as theUpdtControlprocedure.
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
TheUpdateControlsprocedure draws those controls that are in the specified update region. This procedure is faster than theDrawControlsprocedure, which draws all of the controls in a window. By contrast,UpdateControlsdraws only those controls in the update region.Your application should call
UpdateControlsupon receiving an update event for a window that contains controls. Window Manager routines such asSelectWindow,ShowWindow, andBringToFrontdo not automatically callDrawControlsto 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
UpdateControlsafter using the Window Manager procedureBeginUpdateand before using the Window Manager procedureEndUpdate. You should set theupdateRgnparameter to the visible region of the window's port, as specified in the port'svisRgnfield.SPECIAL CONSIDERATIONS
If your application draws parts of a control outside of its rectangle,UpdateControlsmight 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. TheBeginUpdateandEndUpdateprocedures 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.