Carbon


SetControlColor

Header: Controls.h Carbon status: Unsupported

Draws a control using colors other than the default colors used by system software.

void SetControlColor (
    ControlRef theControl, 
    CCTabHandle newColorTable
);
theControl

A handle to the control whose colors you wish to change.

newColorTable

A handle to a control color table structure; see CtlCTab.

DISCUSSION

If you are creating your own custom controls, you can set their colors with the SetControlColor function. Using SetControlColor to apply nonstandard colors to standard system controls is not recommended. When the Appearance Manager is available and you are using standard controls, their colors are determined by the current theme.

The SetControlColor function changes the color table for the specified control. If the control currently has no auxiliary control structure, SetControlColor creates one that includes the control color table structure specified in the parameter newColorTable and adds the auxiliary control structure to the head of the auxiliary control list. If there is already an auxiliary structure for the control, SetControlColor replaces its color table with the contents of the control color table structure specified in the parameter newColorTable.

To use nonstandard colors for a control, you must create a control color table, either by creating a color control table and calling SetControlColor or by creating a control color table resource. Generally, you use SetControlColor when you create a control using NewControl and want to use nonstandard colors for it or when you change any control’s colors after you’ve created it. When you want to use nonstandard colors for those controls you create in a control ('CNTL') resource, you should create a control color table resource with the same resource ID as the control resource.

A control whose colors you set with SetControlColor should initially be invisible. After using SetControlColor to set the control’s colors, use the function ShowControl to make the control visible.

When you create a control color table, your application should not deallocate it if another control is still using it.

AVAILABILITY

Not supported in Carbon. Not available in Carbon.

CARBON NOTES

Custom control color tables are not supported in Carbon.


© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)