Important: The information in this document is obsolete and should not be used for new development.
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 toTRUE
.SPECIAL CONSIDERATIONS
ThecUpdates
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 thecUpdates
parameter is set. You can use theNSetPalette
function, which does the same thing asSetPalette
, when you need greater flexibility in setting criteria for updates. ThenCUpdates
parameter for theNSetPalette
function includes the option of turning off updates when the window is the frontmost window.SEE ALSO
For an example of using theSetPalette
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 theNewPalette
function (page 1-9) to create a new palette.To dispose of a palette, use the
DisposePalette
function (page 1-10).