Important: The information in this document is obsolete and should not be used for new development.
ActivatePalette
Compares the color environment with the color requirements of your window, then changes the device color tables and generates window updates as needed.
pascal void ActivatePalette(WindowPtr srcWindow);
srcWindow
- A pointer to the window for which you want status changes reported.
DISCUSSION
The Window Manager callsActivatePalette
when your window's status changes--for example, when your window opens, closes, moves, or becomes frontmost. You need to call theActivatePalette
function yourself if you change a palette--for example, by changing a color with theSetEntryColor
function--and you want the changes to take place immediately, before the Window Manager would do it.If the window specified in the
srcWindow
parameter is frontmost,ActivatePalette
examines the information stored in the window's palette and attempts to provide the color environment described therein. It determines a list of devices on which to render the palette by intersecting the port rectangle of the window with each device. If the intersection is not empty and if the device has a color table, thenActivatePalette
checks to see if the color environment is sufficient. If a change is required,ActivatePalette
calls the Color Manager to reserve or modify the device's color entries as needed. TheActivatePalette
function then generates update events for all windows that need color updates.Calling
ActivatePalette
for a window with an offscreen port associates the palette with the port, but does not cause any change in the color environment. As a result, callingDisposeWindow
to dispose of the window will no longer dispose of the associated palette automatically, because it may be associated with other ports or windows.
- Note
- An exception to this behavior occurs when an application uses
GetNewCWindow
to create a window, there is no'pltt'
resource with the same ID as the window, and the application has not calledGetPalette
for the window.