Legacy Documentclose button

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

Previous Book Contents Book Index Next

Inside Macintosh: Advanced Color Imaging Reference /
Chapter 1 - Palette Manager Reference /
Palette Manager Functions / Interacting With the Window Manager


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
The GetPalette function returns a handle to the palette associated with the window specified in the srcWindow parameter. If the window has no associated palette or if the window is not a color window, the GetPalette function returns nil.

Normally, the GetPalette function does not allocate memory, with one exception. When your application calls GetPalette to get a copy of the default application palette, the Palette Manager looks at the AppPalette global variable. If AppPalette is nil, 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.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 NOV 1996