Important: The information in this document is obsolete and should not be used for new development.
GetPalette
Obtains a window's palette.
pascal PaletteHandle GetPalette(WindowPtr srcWindow);
srcWindow
- A pointer to the window for which you want the associated palette.
DISCUSSION
TheGetPalette
function returns a handle to the palette associated with the window specified in thesrcWindow
parameter. If the window has no associated palette or if the window is not a color window, theGetPalette
function returnsnil
.Normally, the
GetPalette
function does not allocate memory, with one exception. When your application callsGetPalette
to get a copy of the default application palette, the Palette Manager looks at theAppPalette
global variable. IfAppPalette
isnil
,GetPalette
makes a copy of the default system palette and returns this copy. In all other cases,GetPalette
returns a handle to the requested palette.You request the default palette as follows:
myPaletteHndl = GetPalette ((WindowPtr) -1);SEE ALSO
For more information about the default application palette, see "Designating a Default Palette for Your Application" (page 1-29) in Advanced Color Imaging on the Mac OS.