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


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 calls ActivatePalette when your window's status changes--for example, when your window opens, closes, moves, or becomes frontmost. You need to call the ActivatePalette function yourself if you change a palette--for example, by changing a color with the SetEntryColor 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, then ActivatePalette 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. The ActivatePalette 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, calling DisposeWindow 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 called GetPalette for the window.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 NOV 1996