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
TheGetPalettefunction returns a handle to the palette associated with the window specified in thesrcWindowparameter. If the window has no associated palette or if the window is not a color window, theGetPalettefunction returnsnil.Normally, the
GetPalettefunction does not allocate memory, with one exception. When your application callsGetPaletteto get a copy of the default application palette, the Palette Manager looks at theAppPaletteglobal variable. IfAppPaletteisnil,GetPalettemakes a copy of the default system palette and returns this copy. In all other cases,GetPalettereturns 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.