![]() |
SetThemeTextColorForWindow |
||||
Header: | Appearance.h | Carbon status: | Supported | |
Sets a windows foreground color to a theme-compliant color.
OSStatus SetThemeTextColorForWindow ( WindowRef window, Boolean isActive, SInt16 depth, Boolean isColorDev );
A value of type WindowPtr. Pass a pointer to the window for which to set the text color.
A value of type Boolean. Pass true if the window is currently active; otherwise, false.
A signed 16-bit integer. Pass the bit depth (in bits per pixel) of the current graphics port.
A value of type Boolean. Set to true to indicate that you are drawing on a color device. Set to false for a monochrome device.
A result code. If the specified window does not currently have a theme brush associated with its background or if the associated theme brush is not translatable into a text color, SetThemeTextColorForWindow returns an error.
The SetThemeTextColorForWindow function determines whether the specified window has a theme brush associated with its background and, if so, applies the correct foreground color given the theme brush, the windows activity state, and the current drawing environment. This foreground color is applied to any text drawn after the call to SetThemeTextColorForWindow. Note that SetThemeTextColorForWindow only applies a custom foreground color when the window has a theme brush associated with it or if the window is a Dialog Manager dialog box. If your window is not managed by the Dialog Manager, you must use the function SetThemeWindowBackground to associate a theme brush with the window before calling SetThemeTextColorForWindow.
For example, you can call SetThemeWindowBackground to associate the active alert background theme brush with a window:
SetThemeWindowBackground (myWindow, kThemeBrushAlertBackgroundActive, true
// ...
SetThemeTextColorForWindow (myWindow, true, 16, true)
Then, when you call SetThemeTextColorForWindow, the result is that the windows foreground color is automatically set to the color appropriate for an active alert in the specified drawing environment. In this case, the foreground color that the Appearance Manager would use is that corresponding to the theme text color constant kThemeTextColorAlertActive.
This function is available with Appearance Manager 1.1 and later.
Supported in Carbon. Available in Mac OS 8.1 and later when Carbon 1.0.2 or later is present.
© 2000 Apple Computer, Inc. (Last Updated 5/8/2000)