Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Legacy Legacy Mac OS X Reference Library Mac OS 8 and 9 Developer Documentation


Displaying Controls

The following Control Manager functions for displaying controls are new, changed, or not recommended with Appearance Manager 1.0:


DrawOneControl

Draws a control and any embedded controls that are currently visible in the specified window.

pascal void DrawOneControl (ControlHandle theControl);
theControl
A handle to the control to draw.

DISCUSSION

Although you should generally use the function UpdateControls to update controls, you can use the DrawOneControl function to update a single control. If an embedding hierarchy exists and the control passed in has embedded controls, DrawOneControl draws the control and embedded controls. If the root control for a window is passed in, the result is the same as if DrawControls was called.


VERSION NOTES

Changed with Appearance Manager 1.0 to support embedding hierarchies.


SEE ALSO

Embedding Controls .


DrawControlInCurrentPort

Draws a control in the current graphics port.

pascal void DrawControlInCurrentPort (ControlHandle inControl);
inControl
A handle to the control to draw.

DISCUSSION

Typically, controls are automatically drawn in their owner's graphics port with DrawControls , DrawOneControl , and UpdateControls . DrawControlInCurrentPort permits easy offscreen control drawing and printing. All standard system controls support this function.


VERSION NOTES

Available with Appearance Manager 1.0 and later.


SetUpControlBackground

Sets the background for a control.

pascal OSErr SetUpControlBackground (
                     ControlHandle inControl,
                     SInt16 inDepth,
                     Boolean inIsColorDevice);
inControl
A handle to the control whose background is to be set.
inDepth
The bit depth (in pixels) of the current graphics port.
inIsColorDevice
A Boolean value. Set to true to indicate that you are drawing on a color device; set to false for a monochrome device.
function result
A result code; see Result Codes .

DISCUSSION

The SetUpControlBackground function allows you to set the background of a control. This function is typically called by control definition functions that are embedded in other controls. You might call SetUpControlBackground in response to an application-defined function installed in a user pane control; see Defining Your Own User Pane Functions . SetUpControlBackground ensures that the background color is always correct when calling EraseRect and EraseRgn . If your control spans multiple monitors, SetUpControlBackground should be called for each device that your control is drawing on; see "Graphics Devices" in Imaging With QuickDraw for more details on handling device loops.


VERSION NOTES

Available with Appearance Manager 1.0 and later.


\xA9 1998 Apple Computer, Inc. – (Last Updated 19 Nov 98)