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
cUpdatesparameter toTRUE.SPECIAL CONSIDERATIONS
ThecUpdatesparameter 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 thecUpdatesparameter is set. You can use theNSetPalettefunction, which does the same thing asSetPalette, when you need greater flexibility in setting criteria for updates. ThenCUpdatesparameter for theNSetPalettefunction includes the option of turning off updates when the window is the frontmost window.SEE ALSO
For an example of using theSetPalettefunction 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
NSetPalettefunction (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
GetNewPalettefunction (page 1-8) or theNewPalettefunction (page 1-9) to create a new palette.To dispose of a palette, use the
DisposePalettefunction (page 1-10).
 
  
  
 