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


SetPalette

Associates a palette with a window.

pascal void SetPalette(WindowPtr dstWindow,
                       PaletteHandle srcPalette,
                       Boolean cUpdates);
dstWindow
A pointer to the window to which you want to assign a new palette.
srcPalette
A handle to the palette you want to assign.
cUpdates
A Boolean value in which you specify whether the window is to receive updates as a result of changes to the color environment. If you want the window to be updated whenever its color environment changes, set the cUpdates parameter to TRUE.
SPECIAL CONSIDERATIONS
The cUpdates parameter controls whether changes to the color environment cause update events to be sent to the specified window only if the window is not the frontmost window. When a window is the frontmost window, changes to its palette cause it to get an update event regardless of how the cUpdates parameter is set. You can use the NSetPalette function, which does the same thing as SetPalette, when you need greater flexibility in setting criteria for updates. The nCUpdates parameter for the NSetPalette function includes the option of turning off updates when the window is the frontmost window.

SEE ALSO
For an example of using the SetPalette function to attach a palette to a window, see Listing 1-4 (page 1-28) in Advanced Color Imaging on the Mac OS.

You can also use the NSetPalette function (page 1-12) to associate a palette with a window, but with additional options, so that a variety of conditions can trigger an update event.

Use the GetNewPalette function (page 1-8) or the NewPalette function (page 1-9) to create a new palette.

To dispose of a palette, use the DisposePalette function (page 1-10).


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 NOV 1996